From bb2188561a30d0a7fb293ff05f73907724eb2020 Mon Sep 17 00:00:00 2001 From: nhpd Date: Fri, 11 Aug 2023 14:38:52 +0400 Subject: [PATCH 01/77] feat: add ResubmitSchedule neutron msg --- packages/neutron-sdk/schema/neutron_msg.json | 23 +++++++++++++ packages/neutron-sdk/src/bindings/msg.rs | 34 ++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index ddb82215..2d385d7a 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -445,6 +445,29 @@ } }, "additionalProperties": false + }, + { + "description": "Contractmanager message Resubmits failed acknowledgement. Acknowledgement failure is created when contract returns error or acknowledgement is out of gas. [Permissioned - only from contract that is initial caller of IBC transaction]", + "type": "object", + "required": [ + "resubmit_failure" + ], + "properties": { + "resubmit_failure": { + "type": "object", + "required": [ + "failure_id" + ], + "properties": { + "failure_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false } ], "definitions": { diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 91542e90..51cbe063 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -131,12 +131,14 @@ pub enum NeutronMsg { /// Contracts can create denoms, namespaced under the contract's address. /// A contract may create any number of independent sub-denoms. CreateDenom { subdenom: String }, + /// TokenFactory message. /// Contracts can change the admin of a denom that they are the admin of. ChangeAdmin { denom: String, new_admin_address: String, }, + /// TokenFactory message. /// Contracts can mint native tokens for an existing factory denom /// that they are the admin of. @@ -145,6 +147,7 @@ pub enum NeutronMsg { amount: Uint128, mint_to_address: String, }, + /// TokenFactory message. /// Contracts can burn native tokens for an existing factory denom /// that they are the admin of. @@ -169,9 +172,16 @@ pub enum NeutronMsg { /// list of cosmwasm messages to be executed msgs: Vec, }, + /// RemoveSchedule removes the schedule with a given `name`. /// [Permissioned - DAO or Security DAO only] RemoveSchedule { name: String }, + + /// Contractmanager message + /// Resubmits failed acknowledgement. + /// Acknowledgement failure is created when contract returns error or acknowledgement is out of gas. + /// [Permissioned - only from contract that is initial caller of IBC transaction] + ResubmitFailure { failure_id: u64 }, } impl NeutronMsg { @@ -365,12 +375,17 @@ impl NeutronMsg { } } + // Basic helper to build create denom message passed to TokenFactory module: + // * **subdenom** is a subdenom name for denom to be created. pub fn submit_create_denom(subdenom: impl Into) -> Self { NeutronMsg::CreateDenom { subdenom: subdenom.into(), } } + // Basic helper to define change of admin for a token passed to TokenFactory module: + // * **denom** is a name of the denom to change an admin for; + // * **new_admin_address** is a new admin address for a denom. pub fn submit_change_admin( denom: impl Into, new_admin_address: impl Into, @@ -381,6 +396,10 @@ impl NeutronMsg { } } + // Basic helper to define mint tokens passed to TokenFactory module: + // * **denom** is a name of the denom; + // * **amount** is an amount of tokens to mint; + // * **mint_to_address** is an address that will receive minted tokens. pub fn submit_mint_tokens( denom: impl Into, amount: Uint128, @@ -393,6 +412,9 @@ impl NeutronMsg { } } + // Basic helper to define burn tokens passed to TokenFactory module: + // * **denom** is a name of the denom; + // * **amount** is an amount of tokens to burn. pub fn submit_burn_tokens(denom: impl Into, amount: Uint128) -> Self { NeutronMsg::BurnTokens { denom: denom.into(), @@ -401,13 +423,25 @@ impl NeutronMsg { } } + // Basic helper to define add schedule passed to Cron module: + // * **name** is a name of the schedule; + // * **period** is a period of schedule execution in blocks; + // * **msgs** is the messages that will be executed. pub fn submit_add_schedule(name: String, period: u64, msgs: Vec) -> Self { NeutronMsg::AddSchedule { name, period, msgs } } + // Basic helper to define remove schedule passed to Cron module: + // * **name** is a name of the schedule to be removed. pub fn submit_remove_schedule(name: String) -> Self { NeutronMsg::RemoveSchedule { name } } + + // Basic helper to define resubmit failure passed to Contractmanager module: + // * **failure_id** is an id of the failure to be resubmitted. + pub fn submit_resubmit_failure(failure_id: u64) -> Self { + NeutronMsg::ResubmitFailure { failure_id } + } } impl From for CosmosMsg { From 43de8e72941a3360637976c3b3221d1d82398de8 Mon Sep 17 00:00:00 2001 From: nhpd Date: Mon, 14 Aug 2023 19:25:26 +0400 Subject: [PATCH 02/77] add Failures binding query --- .../neutron-sdk/schema/neutron_query.json | 25 +++++++++++ packages/neutron-sdk/src/bindings/query.rs | 15 ++++++- packages/neutron-sdk/src/bindings/types.rs | 42 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/packages/neutron-sdk/schema/neutron_query.json b/packages/neutron-sdk/schema/neutron_query.json index 15abd5f9..43cb1d0a 100644 --- a/packages/neutron-sdk/schema/neutron_query.json +++ b/packages/neutron-sdk/schema/neutron_query.json @@ -186,6 +186,31 @@ } }, "additionalProperties": false + }, + { + "description": "Contractmanager query. Returns the failures for a particular contract address.", + "type": "object", + "required": [ + "failures" + ], + "properties": { + "failures": { + "type": "object", + "required": [ + "address", + "pagination" + ], + "properties": { + "address": { + "type": "string" + }, + "pagination": { + "$ref": "#/definitions/PageRequest" + } + } + } + }, + "additionalProperties": false } ], "definitions": { diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index b61a797f..c3795d03 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -1,4 +1,4 @@ -use crate::bindings::types::{InterchainQueryResult, RegisteredQuery}; +use crate::bindings::types::{Failure, InterchainQueryResult, RegisteredQuery}; use cosmwasm_std::{Binary, CustomQuery}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -56,6 +56,12 @@ pub enum NeutronQuery { /// TokenFactory query. Returns the admin of a denom, if the denom is a TokenFactory denom. DenomAdmin { subdenom: String }, + + /// Contractmanager query. Returns the failures for a particular contract address. + Failures { + address: String, + pagination: PageRequest, + }, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -108,4 +114,11 @@ pub struct QueryInterchainAccountAddressResponse { pub interchain_account_address: String, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct QueryFailuresResponse { + /// **failures** is a list of failures of sudo handler calls + pub failures: Vec, +} + impl CustomQuery for NeutronQuery {} diff --git a/packages/neutron-sdk/src/bindings/types.rs b/packages/neutron-sdk/src/bindings/types.rs index 8b028f1e..9b70b503 100644 --- a/packages/neutron-sdk/src/bindings/types.rs +++ b/packages/neutron-sdk/src/bindings/types.rs @@ -96,6 +96,48 @@ pub struct StorageValue { pub value: Binary, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct Failure { + /// **channel_id** is an id for channel failure + pub channel_id: String, + // **address** of the failed contract + pub address: String, + // **id** of the failure under specific address + pub id: u64, + /// **sequence_id** is channel sequence id + pub sequence_id: u64, // TODO: is renaming ok?; TODO: remove this since we have sequence_id in packet? + /// **ack_type** is an acknowledgement type ('ack' or 'timeout') + pub ack_type: String, + /// **packet** is an IBC Packet that was sent + pub packet: Packet, + /// **ack** is an acknowledgement data + pub ack: Acknowledgement, +} + +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] +#[serde(rename_all = "snake_case")] +/// IBC packet +pub struct Packet { + pub sequence: u64, + pub source_port: String, + pub source_channel: String, + pub destination_port: String, + pub destination_channel: String, + pub data: Binary, + pub timeout_height: Height, + pub timeout_timestamp: u64, +} + +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] +#[serde(rename_all = "snake_case")] +/// IBC packet +/// TODO: do we need our own structure in order for it to pass through neutron +pub enum Acknowledgement { + Error(String), + Result(Binary), +} + #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] /// Type for wrapping any protobuf message From 96e756ab10ca9b9e40ff3f3c63ffc7e5675f10cf Mon Sep 17 00:00:00 2001 From: nhpd Date: Wed, 16 Aug 2023 17:15:16 +0400 Subject: [PATCH 03/77] Fix pagination request PageRequest --- packages/neutron-sdk/src/bindings/query.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index c3795d03..e90a1379 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -70,21 +70,21 @@ pub struct PageRequest { /// **key** is a value returned in PageResponse.next_key to begin /// querying the next page most efficiently. Only one of offset or key /// should be set. - key: Binary, + pub key: Binary, /// **offset** is a numeric offset that can be used when key is unavailable. /// It is less efficient than using key. Only one of offset or key should /// be set. - offset: u64, + pub offset: u64, /// **limit** is the total number of results to be returned in the result page. /// If left empty it will default to a value to be set by each app. - limit: u64, + pub limit: u64, /// **count_total** is set to true to indicate that the result set should include /// a count of the total number of items available for pagination in UIs. /// count_total is only respected when offset is used. It is ignored when key /// is set. - count_total: bool, + pub count_total: bool, /// reverse is set to true if results are to be returned in the descending order. - reverse: bool, + pub reverse: bool, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From 52fec88aaa3ee72c11c3296455f9068ba73f2af6 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Thu, 17 Aug 2023 11:13:26 +0400 Subject: [PATCH 04/77] add new binding --- packages/neutron-sdk/src/bindings/msg.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 91542e90..33c2a125 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -365,6 +365,14 @@ impl NeutronMsg { } } + /// Basic helper to define sdk47 compatible parameter change proposal passed to AdminModule: + /// * **proposal** is struct which contains proposal that updates params of module directly. + pub fn submit_clear_param_change_new_proposal(proposal: ParamChangeNewProposal) -> Self { + NeutronMsg::SubmitAdminProposal { + admin_proposal: AdminProposal::ParamChangeNewProposal(proposal), + } + } + pub fn submit_create_denom(subdenom: impl Into) -> Self { NeutronMsg::CreateDenom { subdenom: subdenom.into(), @@ -460,6 +468,7 @@ pub enum AdminProposal { SudoContractProposal(SudoContractProposal), UpdateAdminProposal(UpdateAdminProposal), ClearAdminProposal(ClearAdminProposal), + ParamChangeNewProposal(ParamChangeNewProposal), } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -612,6 +621,16 @@ pub struct ClearAdminProposal { pub contract: String, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +/// ParamChangeNewProposal defines the struct for sdk47 compatible update params admin proposal. +pub struct ParamChangeNewProposal { + /// **module** is a name of targe module. + pub module: String, + /// **new_params** is a json representing a struct w new params. + pub new_params: String, +} + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] /// MsgExecuteContract defines a call to the contract execution From 18916490588058f40c97b5db25ee9ae8c2fa4a43 Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 17 Aug 2023 16:26:23 +0400 Subject: [PATCH 05/77] fix Failure types for serialization --- packages/neutron-sdk/src/bindings/types.rs | 47 ++++++++++++++++------ 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/types.rs b/packages/neutron-sdk/src/bindings/types.rs index 9b70b503..ac432f00 100644 --- a/packages/neutron-sdk/src/bindings/types.rs +++ b/packages/neutron-sdk/src/bindings/types.rs @@ -98,43 +98,64 @@ pub struct StorageValue { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] +/// Acknowledgement Failure of sudo handler; can be resubmitted. pub struct Failure { - /// **channel_id** is an id for channel failure - pub channel_id: String, - // **address** of the failed contract + /// **address** of the failed contract pub address: String, - // **id** of the failure under specific address + /// **id** of the failure under specific address pub id: u64, - /// **sequence_id** is channel sequence id - pub sequence_id: u64, // TODO: is renaming ok?; TODO: remove this since we have sequence_id in packet? /// **ack_type** is an acknowledgement type ('ack' or 'timeout') pub ack_type: String, /// **packet** is an IBC Packet that was sent - pub packet: Packet, + pub packet: Option, /// **ack** is an acknowledgement data - pub ack: Acknowledgement, + pub ack: Option, } #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] /// IBC packet pub struct Packet { + /// **sequence** number of packet in ordered channel pub sequence: u64, + + /// **source_port** of packet packet pub source_port: String, + + /// **source_channel** of a packet pub source_channel: String, + + /// **destination_port** of a packet pub destination_port: String, + + /// **destination_channel** of a packet pub destination_channel: String, + + /// **data** of a packet pub data: Binary, - pub timeout_height: Height, - pub timeout_timestamp: u64, + + /// **timeout_height** of a packet + pub timeout_height: Option, + + /// **timeout_timestamp** of a packet + pub timeout_timestamp: Option, } #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] -/// IBC packet -/// TODO: do we need our own structure in order for it to pass through neutron -pub enum Acknowledgement { +/// IBC message Acknowledgement +pub struct Acknowledgement { + #[serde(rename(serialize = "response", deserialize = "Response"))] + pub response: AcknowledgementResponse, +} + +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)] +#[serde(rename_all = "snake_case")] +/// IBC message acknowledgement response +pub enum AcknowledgementResponse { + /// Error response Error(String), + /// Successful response with result as encoded binary Result(Binary), } From a47225518b9b34d88b0e5ebe879ab3d15e22ce7c Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Wed, 23 Aug 2023 13:45:37 +0400 Subject: [PATCH 06/77] remove old bindings, intro new one --- packages/neutron-sdk/src/bindings/msg.rs | 77 +++--------------------- 1 file changed, 9 insertions(+), 68 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 33c2a125..c9982cf9 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -299,24 +299,6 @@ impl NeutronMsg { } } - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that sets upgrade block. - pub fn submit_software_upgrade_proposal(proposal: SoftwareUpgradeProposal) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::SoftwareUpgradeProposal(proposal), - } - } - - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that cancels software upgrade. - pub fn submit_cancel_software_upgrade_proposal( - proposal: CancelSoftwareUpgradeProposal, - ) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::CancelSoftwareUpgradeProposal(proposal), - } - } - /// Basic helper to define a parameter change proposal passed to AdminModule: /// * **proposal** is struct which contains proposal that upgrades network. pub fn submit_upgrade_proposal(proposal: UpgradeProposal) -> Self { @@ -325,22 +307,6 @@ impl NeutronMsg { } } - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that pins code ids. - pub fn submit_pin_codes_proposal(proposal: PinCodesProposal) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::PinCodesProposal(proposal), - } - } - - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that unpins codes ids. - pub fn submit_unpin_codes_proposal(proposal: UnpinCodesProposal) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::UnpinCodesProposal(proposal), - } - } - /// Basic helper to define a parameter change proposal passed to AdminModule: /// * **proposal** is struct which contains proposal updates cliient. pub fn submit_client_update_proposal(proposal: ClientUpdateProposal) -> Self { @@ -349,27 +315,11 @@ impl NeutronMsg { } } - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal updates admin of contract. - pub fn submit_update_admin_proposal(proposal: UpdateAdminProposal) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::UpdateAdminProposal(proposal), - } - } - - /// Basic helper to define a parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that clears admin of contract. - pub fn submit_clear_admin_proposal(proposal: ClearAdminProposal) -> Self { - NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::ClearAdminProposal(proposal), - } - } - - /// Basic helper to define sdk47 compatible parameter change proposal passed to AdminModule: - /// * **proposal** is struct which contains proposal that updates params of module directly. - pub fn submit_clear_param_change_new_proposal(proposal: ParamChangeNewProposal) -> Self { + /// Basic helper to define sdk47 compatible proposal passed to AdminModule: + /// * **proposal** is struct which contains JSON encoded sdk message. + pub fn submit_proposal_execute_message(proposal: ProposalExecuteMessage) -> Self { NeutronMsg::SubmitAdminProposal { - admin_proposal: AdminProposal::ParamChangeNewProposal(proposal), + admin_proposal: AdminProposal::ProposalExecuteMessage(proposal), } } @@ -459,16 +409,9 @@ pub struct MsgIbcTransferResponse { /// AdminProposal defines the struct for various proposals which Neutron's Admin Module may accept. pub enum AdminProposal { ParamChangeProposal(ParamChangeProposal), - SoftwareUpgradeProposal(SoftwareUpgradeProposal), - CancelSoftwareUpgradeProposal(CancelSoftwareUpgradeProposal), UpgradeProposal(UpgradeProposal), ClientUpdateProposal(ClientUpdateProposal), - PinCodesProposal(PinCodesProposal), - UnpinCodesProposal(UnpinCodesProposal), - SudoContractProposal(SudoContractProposal), - UpdateAdminProposal(UpdateAdminProposal), - ClearAdminProposal(ClearAdminProposal), - ParamChangeNewProposal(ParamChangeNewProposal), + ProposalExecuteMessage(ProposalExecuteMessage), } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -623,12 +566,10 @@ pub struct ClearAdminProposal { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// ParamChangeNewProposal defines the struct for sdk47 compatible update params admin proposal. -pub struct ParamChangeNewProposal { - /// **module** is a name of targe module. - pub module: String, - /// **new_params** is a json representing a struct w new params. - pub new_params: String, +/// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. +pub struct ProposalExecuteMessage { + /// **message** is a json representing a struct w new params. + pub message: Binary, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From 97dddc61f3a240b69795fa397540a759577ad304 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Wed, 23 Aug 2023 13:49:58 +0400 Subject: [PATCH 07/77] comms --- packages/neutron-sdk/src/bindings/msg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index c9982cf9..9afad07b 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -568,7 +568,7 @@ pub struct ClearAdminProposal { #[serde(rename_all = "snake_case")] /// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. pub struct ProposalExecuteMessage { - /// **message** is a json representing a struct w new params. + /// **message** is a json representing a sdk message passed to admin module to execute. pub message: Binary, } From c2d16c9f1df23af38a97a0b5611a53415e1c16f1 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Thu, 24 Aug 2023 14:07:22 +0400 Subject: [PATCH 08/77] w o string --- packages/neutron-sdk/src/bindings/msg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 9afad07b..509949a5 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -569,7 +569,7 @@ pub struct ClearAdminProposal { /// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. pub struct ProposalExecuteMessage { /// **message** is a json representing a sdk message passed to admin module to execute. - pub message: Binary, + pub message: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From c29a31cb2d6cdcc499d0ef64f149c60c9389efe5 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Thu, 24 Aug 2023 15:13:55 +0400 Subject: [PATCH 09/77] rm rudiment --- packages/neutron-sdk/src/bindings/msg.rs | 57 ------------------------ 1 file changed, 57 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 509949a5..9652cfab 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -438,28 +438,6 @@ pub struct ParamChange { pub value: String, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// SoftwareUpgradeProposal defines the struct for software upgrade proposal. -pub struct SoftwareUpgradeProposal { - /// **title** is a text title of proposal. Non unique. - pub title: String, - /// **description** is a text description of proposal. Non unique. - pub description: String, - /// **plan** is a plan of upgrade. - pub plan: Plan, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal. -pub struct CancelSoftwareUpgradeProposal { - /// **title** is a text title of proposal. Non unique. - pub title: String, - /// **description** is a text description of proposal. Non unique. - pub description: String, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] /// Plan defines the struct for planned upgrade. @@ -500,30 +478,6 @@ pub struct ClientUpdateProposal { pub substitute_client_id: String, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// PinCodesProposal defines the struct for pin contract codes proposal. -pub struct PinCodesProposal { - /// **title** is a text title of proposal. - pub title: String, - /// **description** is a text description of proposal. - pub description: String, - /// **code_ids** is an array of codes to be pined. - pub code_ids: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// UnpinCodesProposal defines the struct for unpin contract codes proposal. -pub struct UnpinCodesProposal { - /// **title** is a text title of proposal. - pub title: String, - /// **description** is a text description of proposal. - pub description: String, - /// **code_ids** is an array of codes to be unpined. - pub code_ids: Vec, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] /// SudoContractProposal defines the struct for sudo execution proposal. @@ -552,17 +506,6 @@ pub struct UpdateAdminProposal { pub contract: String, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// SudoContractProposal defines the struct for clear admin proposal. -pub struct ClearAdminProposal { - /// **title** is a text title of proposal. - pub title: String, - /// **description** is a text description of proposal. - pub description: String, - /// **contract** is an address of contract admin will be removed. - pub contract: String, -} #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] From 157f63da6fcf48fe352a6363741fbf6eff340d4d Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Thu, 24 Aug 2023 23:31:53 +0400 Subject: [PATCH 10/77] value --- packages/neutron-sdk/src/bindings/msg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 9652cfab..72597d2a 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -8,6 +8,7 @@ use crate::{ use cosmwasm_std::{Binary, Coin, CosmosMsg, CustomMsg, StdError, Uint128}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use serde_json::Value; use serde_json_wasm::to_string; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -506,13 +507,12 @@ pub struct UpdateAdminProposal { pub contract: String, } - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] /// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. pub struct ProposalExecuteMessage { /// **message** is a json representing a sdk message passed to admin module to execute. - pub message: String, + pub message: Value, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From cfb3c83b56979f0592d8c4fd5be98031cfe8ec3e Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 25 Aug 2023 11:34:58 +0400 Subject: [PATCH 11/77] explicit string typing due the cw limitations --- packages/neutron-sdk/src/bindings/msg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 72597d2a..663ba8b3 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -512,7 +512,7 @@ pub struct UpdateAdminProposal { /// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. pub struct ProposalExecuteMessage { /// **message** is a json representing a sdk message passed to admin module to execute. - pub message: Value, + pub message: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] From 697d826f749f2e292121b00b8b0defb49f369998 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 25 Aug 2023 13:49:27 +0400 Subject: [PATCH 12/77] rm legacy code --- packages/neutron-sdk/src/bindings/msg.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 663ba8b3..9efa562b 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -8,7 +8,6 @@ use crate::{ use cosmwasm_std::{Binary, Coin, CosmosMsg, CustomMsg, StdError, Uint128}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use serde_json::Value; use serde_json_wasm::to_string; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -493,20 +492,6 @@ pub struct SudoContractProposal { pub msg: Binary, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -/// UpdateAdminProposal defines the struct for update admin proposal. -pub struct UpdateAdminProposal { - /// **title** is a text title of proposal. - pub title: String, - /// **description** is a text description of proposal. - pub description: String, - /// ***new_admin*** is an address of new admin - pub new_admin: String, - /// **contract** is an address of contract to update admin. - pub contract: String, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] /// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. From 756a026e8b9ac6afc4b027337a41a8cba669f95f Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Wed, 6 Sep 2023 12:54:14 +0400 Subject: [PATCH 13/77] more precise comments --- packages/neutron-sdk/src/bindings/msg.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 9efa562b..3f26b50a 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -299,7 +299,7 @@ impl NeutronMsg { } } - /// Basic helper to define a parameter change proposal passed to AdminModule: + /// Basic helper to define an ibc upgrade proposal passed to AdminModule: /// * **proposal** is struct which contains proposal that upgrades network. pub fn submit_upgrade_proposal(proposal: UpgradeProposal) -> Self { NeutronMsg::SubmitAdminProposal { @@ -307,7 +307,7 @@ impl NeutronMsg { } } - /// Basic helper to define a parameter change proposal passed to AdminModule: + /// Basic helper to define an ibc update client change proposal passed to AdminModule: /// * **proposal** is struct which contains proposal updates cliient. pub fn submit_client_update_proposal(proposal: ClientUpdateProposal) -> Self { NeutronMsg::SubmitAdminProposal { @@ -494,9 +494,9 @@ pub struct SudoContractProposal { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// ProposalExecuteMessage defines the struct for sdk47 compatible update params admin proposal. +/// ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal. pub struct ProposalExecuteMessage { - /// **message** is a json representing a sdk message passed to admin module to execute. + /// **message** is a json representing an sdk message passed to admin module to execute. pub message: String, } From 2c9e8e63086600b7d232aa858d13fd34037ae056 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 8 Sep 2023 11:53:04 +0400 Subject: [PATCH 14/77] add set before send hook binding --- packages/neutron-sdk/src/bindings/msg.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index c0193696..289261c6 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -159,6 +159,11 @@ pub enum NeutronMsg { burn_from_address: String, }, + /// TokenFactory message. + /// Contracts can create denoms, namespaced under the contract's address. + /// A contract may create any number of independent sub-denoms. + SetBeforeSendHook { denom: String, cosm_wasm_addr: String }, + /// AddSchedule adds new schedule with a given `name`. /// Until schedule is removed it will execute all `msgs` every `period` blocks. /// First execution is at least on `current_block + period` block. @@ -381,6 +386,15 @@ impl NeutronMsg { } } + // Basic helper to build create denom message passed to TokenFactory module: + // * **denom** is a name for denom for hook to be created. + pub fn submit_set_before_send_hoook(denom: impl Into, cosm_wasm_addr: impl Into ) -> Self { + NeutronMsg::SetBeforeSendHook { + denom: denom.into(), + cosm_wasm_addr: cosm_wasm_addr.into() + } + } + // Basic helper to define add schedule passed to Cron module: // * **name** is a name of the schedule; // * **period** is a period of schedule execution in blocks; From f85ea512f5d96729ec507de33dbf97ca64ca7046 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 8 Sep 2023 12:04:34 +0400 Subject: [PATCH 15/77] fmtt --- packages/neutron-sdk/src/bindings/msg.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 289261c6..e1e883a5 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -162,7 +162,10 @@ pub enum NeutronMsg { /// TokenFactory message. /// Contracts can create denoms, namespaced under the contract's address. /// A contract may create any number of independent sub-denoms. - SetBeforeSendHook { denom: String, cosm_wasm_addr: String }, + SetBeforeSendHook { + denom: String, + cosm_wasm_addr: String, + }, /// AddSchedule adds new schedule with a given `name`. /// Until schedule is removed it will execute all `msgs` every `period` blocks. @@ -388,10 +391,13 @@ impl NeutronMsg { // Basic helper to build create denom message passed to TokenFactory module: // * **denom** is a name for denom for hook to be created. - pub fn submit_set_before_send_hoook(denom: impl Into, cosm_wasm_addr: impl Into ) -> Self { + pub fn submit_set_before_send_hoook( + denom: impl Into, + cosm_wasm_addr: impl Into, + ) -> Self { NeutronMsg::SetBeforeSendHook { denom: denom.into(), - cosm_wasm_addr: cosm_wasm_addr.into() + cosm_wasm_addr: cosm_wasm_addr.into(), } } From 09b603e3a1024231f09398a6fd93af56519f312d Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 8 Sep 2023 12:15:34 +0400 Subject: [PATCH 16/77] queries --- packages/neutron-sdk/src/bindings/query.rs | 3 +++ packages/neutron-sdk/src/query/token_factory.rs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index e90a1379..218d0b6d 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -57,6 +57,9 @@ pub enum NeutronQuery { /// TokenFactory query. Returns the admin of a denom, if the denom is a TokenFactory denom. DenomAdmin { subdenom: String }, + /// TokenFactory query. Returns the before send hook of a denom, if the denom is a TokenFactory denom. + BeforeSendHook { denom: String }, + /// Contractmanager query. Returns the failures for a particular contract address. Failures { address: String, diff --git a/packages/neutron-sdk/src/query/token_factory.rs b/packages/neutron-sdk/src/query/token_factory.rs index 28590589..9db45c59 100644 --- a/packages/neutron-sdk/src/query/token_factory.rs +++ b/packages/neutron-sdk/src/query/token_factory.rs @@ -15,6 +15,12 @@ pub struct DenomAdminResponse { pub admin: String, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct BeforeSendHookResponse { + pub cosm_wasm_address: String, +} + pub fn query_full_denom( deps: Deps, creator_addr: impl Into, @@ -36,3 +42,13 @@ pub fn query_denom_admin( }; Ok(deps.querier.query(&query.into())?) } + +pub fn query_before_send_hook( + deps: Deps, + denom: impl Into, +) -> NeutronResult { + let query = NeutronQuery::BeforeSendHook { + denom: denom.into(), + }; + Ok(deps.querier.query(&query.into())?) +} From 116125798a35f07881efce402d28574574d5ab6b Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Fri, 8 Sep 2023 15:55:19 +0400 Subject: [PATCH 17/77] fix query --- packages/neutron-sdk/src/query/token_factory.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/query/token_factory.rs b/packages/neutron-sdk/src/query/token_factory.rs index 9db45c59..ebb1507f 100644 --- a/packages/neutron-sdk/src/query/token_factory.rs +++ b/packages/neutron-sdk/src/query/token_factory.rs @@ -18,7 +18,7 @@ pub struct DenomAdminResponse { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct BeforeSendHookResponse { - pub cosm_wasm_address: String, + pub cosm_wasm_addr: String, } pub fn query_full_denom( From 67df47060976039d42bf7ed06fc291d15963eeaa Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Mon, 11 Sep 2023 13:23:38 +0400 Subject: [PATCH 18/77] fix comment --- packages/neutron-sdk/src/bindings/msg.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index e1e883a5..a88066d3 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -160,8 +160,7 @@ pub enum NeutronMsg { }, /// TokenFactory message. - /// Contracts can create denoms, namespaced under the contract's address. - /// A contract may create any number of independent sub-denoms. + /// Contracts can set before send hooks for denoms, namespaced under the contract's address. SetBeforeSendHook { denom: String, cosm_wasm_addr: String, From e6bd065d7f8020834553b9590e94a1dc1cd5e0e4 Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Tue, 12 Sep 2023 16:11:42 +0400 Subject: [PATCH 19/77] fix commets --- packages/neutron-sdk/src/bindings/msg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index a88066d3..387eb48a 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -388,7 +388,7 @@ impl NeutronMsg { } } - // Basic helper to build create denom message passed to TokenFactory module: + // Basic helper to create set before send hook message passed to TokenFactory module: // * **denom** is a name for denom for hook to be created. pub fn submit_set_before_send_hoook( denom: impl Into, From 39dcea6f2d3a3d098d738bca6cc6608dcce4e36d Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Tue, 12 Sep 2023 16:12:17 +0400 Subject: [PATCH 20/77] comment --- packages/neutron-sdk/src/bindings/query.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index 218d0b6d..eda84639 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -57,7 +57,7 @@ pub enum NeutronQuery { /// TokenFactory query. Returns the admin of a denom, if the denom is a TokenFactory denom. DenomAdmin { subdenom: String }, - /// TokenFactory query. Returns the before send hook of a denom, if the denom is a TokenFactory denom. + /// TokenFactory query. Returns the before send hook address of a denom, if the denom is a TokenFactory denom. BeforeSendHook { denom: String }, /// Contractmanager query. Returns the failures for a particular contract address. From 9609e48f5305e8e61871756eae33bc927bca7bae Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Wed, 13 Sep 2023 14:33:15 +0400 Subject: [PATCH 21/77] upd query --- packages/neutron-sdk/src/query/token_factory.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/query/token_factory.rs b/packages/neutron-sdk/src/query/token_factory.rs index ebb1507f..82060562 100644 --- a/packages/neutron-sdk/src/query/token_factory.rs +++ b/packages/neutron-sdk/src/query/token_factory.rs @@ -18,7 +18,7 @@ pub struct DenomAdminResponse { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct BeforeSendHookResponse { - pub cosm_wasm_addr: String, + pub contract_addr: String, } pub fn query_full_denom( From 8f8865870b91cb4c072c42934a621572c2634712 Mon Sep 17 00:00:00 2001 From: swelf Date: Fri, 15 Sep 2023 04:23:43 +0300 Subject: [PATCH 22/77] added register_fee field --- .../schema/execute_msg.json | 32 +- .../neutron_interchain_txs/src/contract.rs | 21 +- contracts/neutron_interchain_txs/src/msg.rs | 2 + packages/neutron-sdk/schema/neutron_msg.json | 285 ++---------------- packages/neutron-sdk/src/bindings/msg.rs | 5 + 5 files changed, 78 insertions(+), 267 deletions(-) diff --git a/contracts/neutron_interchain_txs/schema/execute_msg.json b/contracts/neutron_interchain_txs/schema/execute_msg.json index 32b0ae95..528b52cc 100644 --- a/contracts/neutron_interchain_txs/schema/execute_msg.json +++ b/contracts/neutron_interchain_txs/schema/execute_msg.json @@ -12,7 +12,8 @@ "type": "object", "required": [ "connection_id", - "interchain_account_id" + "interchain_account_id", + "register_fee" ], "properties": { "connection_id": { @@ -20,6 +21,12 @@ }, "interchain_account_id": { "type": "string" + }, + "register_fee": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } } } } @@ -110,5 +117,26 @@ }, "additionalProperties": false } - ] + ], + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } } diff --git a/contracts/neutron_interchain_txs/src/contract.rs b/contracts/neutron_interchain_txs/src/contract.rs index f9bbd2f3..f3879953 100644 --- a/contracts/neutron_interchain_txs/src/contract.rs +++ b/contracts/neutron_interchain_txs/src/contract.rs @@ -5,8 +5,8 @@ use cosmos_sdk_proto::cosmos::staking::v1beta1::{ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - to_binary, Binary, CosmosMsg, CustomQuery, Deps, DepsMut, Env, MessageInfo, Reply, Response, - StdError, StdResult, SubMsg, + to_binary, Binary, Coin as CoinSDK, CosmosMsg, CustomQuery, Deps, DepsMut, Env, MessageInfo, + Reply, Response, StdError, StdResult, SubMsg, }; use cw2::set_contract_version; use prost::Message; @@ -78,7 +78,14 @@ pub fn execute( ExecuteMsg::Register { connection_id, interchain_account_id, - } => execute_register_ica(deps, env, connection_id, interchain_account_id), + register_fee, + } => execute_register_ica( + deps, + env, + connection_id, + interchain_account_id, + register_fee, + ), ExecuteMsg::Delegate { validator, interchain_account_id, @@ -188,9 +195,13 @@ fn execute_register_ica( env: Env, connection_id: String, interchain_account_id: String, + register_fee: Vec, ) -> NeutronResult> { - let register = - NeutronMsg::register_interchain_account(connection_id, interchain_account_id.clone()); + let register = NeutronMsg::register_interchain_account( + connection_id, + interchain_account_id.clone(), + register_fee, + ); let key = get_port_id(env.contract.address.as_str(), &interchain_account_id); // we are saving empty data here because we handle response of registering ICA in sudo_open_ack method INTERCHAIN_ACCOUNTS.save(deps.storage, key, &None)?; diff --git a/contracts/neutron_interchain_txs/src/msg.rs b/contracts/neutron_interchain_txs/src/msg.rs index 5c24f5fc..b81e72c7 100644 --- a/contracts/neutron_interchain_txs/src/msg.rs +++ b/contracts/neutron_interchain_txs/src/msg.rs @@ -1,3 +1,4 @@ +use cosmwasm_std::Coin; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -34,6 +35,7 @@ pub enum ExecuteMsg { Register { connection_id: String, interchain_account_id: String, + register_fee: Vec, }, Delegate { interchain_account_id: String, diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index 2d385d7a..fc333c5d 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -14,7 +14,8 @@ "type": "object", "required": [ "connection_id", - "interchain_account_id" + "interchain_account_id", + "register_fee" ], "properties": { "connection_id": { @@ -24,6 +25,13 @@ "interchain_account_id": { "description": "**interchain_account_id** is an identifier of your new interchain account. Can be any string. This identifier allows contracts to have multiple interchain accounts on remote chains.", "type": "string" + }, + "register_fee": { + "description": "*register_fee** is a fees required to be payed to register interchain account", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } } } } @@ -486,30 +494,6 @@ }, "additionalProperties": false }, - { - "type": "object", - "required": [ - "software_upgrade_proposal" - ], - "properties": { - "software_upgrade_proposal": { - "$ref": "#/definitions/SoftwareUpgradeProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cancel_software_upgrade_proposal" - ], - "properties": { - "cancel_software_upgrade_proposal": { - "$ref": "#/definitions/CancelSoftwareUpgradeProposal" - } - }, - "additionalProperties": false - }, { "type": "object", "required": [ @@ -537,59 +521,11 @@ { "type": "object", "required": [ - "pin_codes_proposal" + "proposal_execute_message" ], "properties": { - "pin_codes_proposal": { - "$ref": "#/definitions/PinCodesProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "unpin_codes_proposal" - ], - "properties": { - "unpin_codes_proposal": { - "$ref": "#/definitions/UnpinCodesProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "sudo_contract_proposal" - ], - "properties": { - "sudo_contract_proposal": { - "$ref": "#/definitions/SudoContractProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "update_admin_proposal" - ], - "properties": { - "update_admin_proposal": { - "$ref": "#/definitions/UpdateAdminProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "clear_admin_proposal" - ], - "properties": { - "clear_admin_proposal": { - "$ref": "#/definitions/ClearAdminProposal" + "proposal_execute_message": { + "$ref": "#/definitions/ProposalExecuteMessage" } }, "additionalProperties": false @@ -600,47 +536,6 @@ "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, - "CancelSoftwareUpgradeProposal": { - "description": "CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal.", - "type": "object", - "required": [ - "description", - "title" - ], - "properties": { - "description": { - "description": "*description** is a text description of proposal. Non unique.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal. Non unique.", - "type": "string" - } - } - }, - "ClearAdminProposal": { - "description": "SudoContractProposal defines the struct for clear admin proposal.", - "type": "object", - "required": [ - "contract", - "description", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract admin will be removed.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "ClientUpdateProposal": { "description": "ClientUpdateProposal defines the struct for client update proposal.", "type": "object", @@ -805,34 +700,6 @@ } } }, - "PinCodesProposal": { - "description": "PinCodesProposal defines the struct for pin contract codes proposal.", - "type": "object", - "required": [ - "code_ids", - "description", - "title" - ], - "properties": { - "code_ids": { - "description": "*code_ids** is an array of codes to be pined.", - "type": "array", - "items": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "Plan": { "description": "Plan defines the struct for planned upgrade.", "type": "object", @@ -857,6 +724,19 @@ } } }, + "ProposalExecuteMessage": { + "description": "ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal.", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "*message** is a json representing an sdk message passed to admin module to execute.", + "type": "string" + } + } + }, "ProtobufAny": { "description": "Type for wrapping any protobuf message", "type": "object", @@ -900,125 +780,10 @@ } } }, - "SoftwareUpgradeProposal": { - "description": "SoftwareUpgradeProposal defines the struct for software upgrade proposal.", - "type": "object", - "required": [ - "description", - "plan", - "title" - ], - "properties": { - "description": { - "description": "*description** is a text description of proposal. Non unique.", - "type": "string" - }, - "plan": { - "description": "*plan** is a plan of upgrade.", - "allOf": [ - { - "$ref": "#/definitions/Plan" - } - ] - }, - "title": { - "description": "*title** is a text title of proposal. Non unique.", - "type": "string" - } - } - }, - "SudoContractProposal": { - "description": "SudoContractProposal defines the struct for sudo execution proposal.", - "type": "object", - "required": [ - "contract", - "description", - "msg", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract to be executed.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "msg": { - "description": "**msg*** is a sudo message.", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" }, - "UnpinCodesProposal": { - "description": "UnpinCodesProposal defines the struct for unpin contract codes proposal.", - "type": "object", - "required": [ - "code_ids", - "description", - "title" - ], - "properties": { - "code_ids": { - "description": "*code_ids** is an array of codes to be unpined.", - "type": "array", - "items": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, - "UpdateAdminProposal": { - "description": "UpdateAdminProposal defines the struct for update admin proposal.", - "type": "object", - "required": [ - "contract", - "description", - "new_admin", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract to update admin.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "new_admin": { - "description": "**new_admin*** is an address of new admin", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "UpgradeProposal": { "description": "UpgradeProposal defines the struct for upgrade proposal.", "type": "object", diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index c0193696..3d011a96 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -38,6 +38,9 @@ pub enum NeutronMsg { /// **interchain_account_id** is an identifier of your new interchain account. Can be any string. /// This identifier allows contracts to have multiple interchain accounts on remote chains. interchain_account_id: String, + + /// **register_fee** is a fees required to be payed to register interchain account + register_fee: Vec, }, /// SubmitTx starts the process of executing any Cosmos-SDK *msgs* on remote chain. @@ -191,10 +194,12 @@ impl NeutronMsg { pub fn register_interchain_account( connection_id: String, interchain_account_id: String, + register_fee: Vec, ) -> Self { NeutronMsg::RegisterInterchainAccount { connection_id, interchain_account_id, + register_fee, } } From 549595cceb2aecce1b970d76cc32e9de6439a1d1 Mon Sep 17 00:00:00 2001 From: nhpd Date: Tue, 19 Sep 2023 15:45:39 +0400 Subject: [PATCH 23/77] rename cosmwasm_address -> contract_addr for set hook msg --- packages/neutron-sdk/schema/neutron_msg.json | 300 +++--------------- .../neutron-sdk/schema/neutron_query.json | 21 ++ packages/neutron-sdk/src/bindings/msg.rs | 8 +- 3 files changed, 66 insertions(+), 263 deletions(-) diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index 2d385d7a..6b52e5a9 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -388,6 +388,31 @@ }, "additionalProperties": false }, + { + "description": "TokenFactory message. Contracts can set before send hooks for denoms, namespaced under the contract's address.", + "type": "object", + "required": [ + "set_before_send_hook" + ], + "properties": { + "set_before_send_hook": { + "type": "object", + "required": [ + "contract_addr", + "denom" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, { "description": "AddSchedule adds new schedule with a given `name`. Until schedule is removed it will execute all `msgs` every `period` blocks. First execution is at least on `current_block + period` block. [Permissioned - DAO Only]", "type": "object", @@ -486,30 +511,6 @@ }, "additionalProperties": false }, - { - "type": "object", - "required": [ - "software_upgrade_proposal" - ], - "properties": { - "software_upgrade_proposal": { - "$ref": "#/definitions/SoftwareUpgradeProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cancel_software_upgrade_proposal" - ], - "properties": { - "cancel_software_upgrade_proposal": { - "$ref": "#/definitions/CancelSoftwareUpgradeProposal" - } - }, - "additionalProperties": false - }, { "type": "object", "required": [ @@ -537,59 +538,11 @@ { "type": "object", "required": [ - "pin_codes_proposal" - ], - "properties": { - "pin_codes_proposal": { - "$ref": "#/definitions/PinCodesProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "unpin_codes_proposal" - ], - "properties": { - "unpin_codes_proposal": { - "$ref": "#/definitions/UnpinCodesProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "sudo_contract_proposal" - ], - "properties": { - "sudo_contract_proposal": { - "$ref": "#/definitions/SudoContractProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "update_admin_proposal" + "proposal_execute_message" ], "properties": { - "update_admin_proposal": { - "$ref": "#/definitions/UpdateAdminProposal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "clear_admin_proposal" - ], - "properties": { - "clear_admin_proposal": { - "$ref": "#/definitions/ClearAdminProposal" + "proposal_execute_message": { + "$ref": "#/definitions/ProposalExecuteMessage" } }, "additionalProperties": false @@ -600,47 +553,6 @@ "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, - "CancelSoftwareUpgradeProposal": { - "description": "CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal.", - "type": "object", - "required": [ - "description", - "title" - ], - "properties": { - "description": { - "description": "*description** is a text description of proposal. Non unique.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal. Non unique.", - "type": "string" - } - } - }, - "ClearAdminProposal": { - "description": "SudoContractProposal defines the struct for clear admin proposal.", - "type": "object", - "required": [ - "contract", - "description", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract admin will be removed.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "ClientUpdateProposal": { "description": "ClientUpdateProposal defines the struct for client update proposal.", "type": "object", @@ -805,34 +717,6 @@ } } }, - "PinCodesProposal": { - "description": "PinCodesProposal defines the struct for pin contract codes proposal.", - "type": "object", - "required": [ - "code_ids", - "description", - "title" - ], - "properties": { - "code_ids": { - "description": "*code_ids** is an array of codes to be pined.", - "type": "array", - "items": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "Plan": { "description": "Plan defines the struct for planned upgrade.", "type": "object", @@ -857,6 +741,19 @@ } } }, + "ProposalExecuteMessage": { + "description": "ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal.", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "*message** is a json representing an sdk message passed to admin module to execute.", + "type": "string" + } + } + }, "ProtobufAny": { "description": "Type for wrapping any protobuf message", "type": "object", @@ -900,125 +797,10 @@ } } }, - "SoftwareUpgradeProposal": { - "description": "SoftwareUpgradeProposal defines the struct for software upgrade proposal.", - "type": "object", - "required": [ - "description", - "plan", - "title" - ], - "properties": { - "description": { - "description": "*description** is a text description of proposal. Non unique.", - "type": "string" - }, - "plan": { - "description": "*plan** is a plan of upgrade.", - "allOf": [ - { - "$ref": "#/definitions/Plan" - } - ] - }, - "title": { - "description": "*title** is a text title of proposal. Non unique.", - "type": "string" - } - } - }, - "SudoContractProposal": { - "description": "SudoContractProposal defines the struct for sudo execution proposal.", - "type": "object", - "required": [ - "contract", - "description", - "msg", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract to be executed.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "msg": { - "description": "**msg*** is a sudo message.", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" }, - "UnpinCodesProposal": { - "description": "UnpinCodesProposal defines the struct for unpin contract codes proposal.", - "type": "object", - "required": [ - "code_ids", - "description", - "title" - ], - "properties": { - "code_ids": { - "description": "*code_ids** is an array of codes to be unpined.", - "type": "array", - "items": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, - "UpdateAdminProposal": { - "description": "UpdateAdminProposal defines the struct for update admin proposal.", - "type": "object", - "required": [ - "contract", - "description", - "new_admin", - "title" - ], - "properties": { - "contract": { - "description": "*contract** is an address of contract to update admin.", - "type": "string" - }, - "description": { - "description": "*description** is a text description of proposal.", - "type": "string" - }, - "new_admin": { - "description": "**new_admin*** is an address of new admin", - "type": "string" - }, - "title": { - "description": "*title** is a text title of proposal.", - "type": "string" - } - } - }, "UpgradeProposal": { "description": "UpgradeProposal defines the struct for upgrade proposal.", "type": "object", diff --git a/packages/neutron-sdk/schema/neutron_query.json b/packages/neutron-sdk/schema/neutron_query.json index 43cb1d0a..06e194db 100644 --- a/packages/neutron-sdk/schema/neutron_query.json +++ b/packages/neutron-sdk/schema/neutron_query.json @@ -187,6 +187,27 @@ }, "additionalProperties": false }, + { + "description": "TokenFactory query. Returns the before send hook address of a denom, if the denom is a TokenFactory denom.", + "type": "object", + "required": [ + "before_send_hook" + ], + "properties": { + "before_send_hook": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, { "description": "Contractmanager query. Returns the failures for a particular contract address.", "type": "object", diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 387eb48a..4fbd674a 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -163,7 +163,7 @@ pub enum NeutronMsg { /// Contracts can set before send hooks for denoms, namespaced under the contract's address. SetBeforeSendHook { denom: String, - cosm_wasm_addr: String, + contract_addr: String, }, /// AddSchedule adds new schedule with a given `name`. @@ -390,13 +390,13 @@ impl NeutronMsg { // Basic helper to create set before send hook message passed to TokenFactory module: // * **denom** is a name for denom for hook to be created. - pub fn submit_set_before_send_hoook( + pub fn submit_set_before_send_hook( denom: impl Into, - cosm_wasm_addr: impl Into, + contract_addr: impl Into, ) -> Self { NeutronMsg::SetBeforeSendHook { denom: denom.into(), - cosm_wasm_addr: cosm_wasm_addr.into(), + contract_addr: contract_addr.into(), } } From e2ef838b9c39d057d5d7e37d0755752c49d153bc Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 28 Sep 2023 14:40:21 +0400 Subject: [PATCH 24/77] update version of sdk to 1.7.0; deprecate old admin proposals --- contracts/ibc_transfer/Cargo.toml | 2 +- .../neutron_interchain_queries/Cargo.toml | 2 +- contracts/neutron_interchain_txs/Cargo.toml | 2 +- packages/neutron-sdk/Cargo.toml | 2 +- packages/neutron-sdk/src/bindings/mod.rs | 1 + packages/neutron-sdk/src/bindings/msg.rs | 177 +++++++++++++++++- 6 files changed, 172 insertions(+), 14 deletions(-) diff --git a/contracts/ibc_transfer/Cargo.toml b/contracts/ibc_transfer/Cargo.toml index b46242fe..d496df1a 100644 --- a/contracts/ibc_transfer/Cargo.toml +++ b/contracts/ibc_transfer/Cargo.toml @@ -39,7 +39,7 @@ schemars = "0.8.10" serde = { version = "1.0.149", default-features = false, features = ["derive"] } serde-json-wasm = { version = "0.5.1" } cw-storage-plus = { version = "1.1.0", features = ["iterator"]} -neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.6.1"} +neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.7.0"} protobuf = { version = "3.2.0", features = ["with-bytes"] } [dev-dependencies] diff --git a/contracts/neutron_interchain_queries/Cargo.toml b/contracts/neutron_interchain_queries/Cargo.toml index a7ffc747..28778c93 100644 --- a/contracts/neutron_interchain_queries/Cargo.toml +++ b/contracts/neutron_interchain_queries/Cargo.toml @@ -36,7 +36,7 @@ cosmwasm-std = { version = "1.3.0", features = ["staking"] } cw2 = "1.1.0" schemars = "0.8.10" serde = { version = "1.0.149", default-features = false, features = ["derive"] } -neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.6.1"} +neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.7.0"} base64 = "0.21.2" cosmos-sdk-proto = { version = "0.16.0", default-features = false } cw-storage-plus = { version = "1.1.0", features = ["iterator"]} diff --git a/contracts/neutron_interchain_txs/Cargo.toml b/contracts/neutron_interchain_txs/Cargo.toml index 7ae161ec..7d45708f 100644 --- a/contracts/neutron_interchain_txs/Cargo.toml +++ b/contracts/neutron_interchain_txs/Cargo.toml @@ -39,7 +39,7 @@ serde = { version = "1.0.149", default-features = false, features = ["derive"] } serde-json-wasm = { version = "0.5.1" } cw-storage-plus = { version = "1.1.0", features = ["iterator"]} cosmos-sdk-proto = { version = "0.16.0", default-features = false } -neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.6.1"} +neutron-sdk = { path = "../../packages/neutron-sdk", default-features = false, version = "0.7.0"} base64 = "0.21.2" protobuf = { version = "3.2.0", features = ["with-bytes"] } prost = "0.11" diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index 60033259..1209bf74 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "neutron-sdk" description = "Neutron CosmWasm SDK for interacting with Neutron blockchain" -version = "0.6.1" +version = "0.7.0" edition = "2021" license = "Apache-2.0" repository = "https://github.com/neutron-org/neutron-sdk" diff --git a/packages/neutron-sdk/src/bindings/mod.rs b/packages/neutron-sdk/src/bindings/mod.rs index 299b4f33..8ebe3644 100644 --- a/packages/neutron-sdk/src/bindings/mod.rs +++ b/packages/neutron-sdk/src/bindings/mod.rs @@ -1,3 +1,4 @@ +#[allow(deprecated)] pub mod msg; pub mod query; pub mod types; diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 5b7053a5..67c529dc 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -466,10 +466,67 @@ pub struct MsgIbcTransferResponse { #[serde(rename_all = "snake_case")] /// AdminProposal defines the struct for various proposals which Neutron's Admin Module may accept. pub enum AdminProposal { + /// Proposal to change params. Note that this works for old params. + /// New params has their own `MsgUpdateParams` msgs that can be supplied to `ProposalExecuteMessage` ParamChangeProposal(ParamChangeProposal), + + /// Proposal to upgrade network using given `Plan` UpgradeProposal(UpgradeProposal), + + /// Proposal to update IBC client ClientUpdateProposal(ClientUpdateProposal), + + /// Proposal to execute CosmosMsg. ProposalExecuteMessage(ProposalExecuteMessage), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + SoftwareUpgradeProposal(SoftwareUpgradeProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + CancelSoftwareUpgradeProposal(CancelSoftwareUpgradeProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + PinCodesProposal(PinCodesProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + UnpinCodesProposal(UnpinCodesProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + SudoContractProposal(SudoContractProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + UpdateAdminProposal(UpdateAdminProposal), + + /// Deprecated. Will fail to execute if you use it. + #[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" + )] + ClearAdminProposal(ClearAdminProposal), } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -538,7 +595,59 @@ pub struct ClientUpdateProposal { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// SudoContractProposal defines the struct for sudo execution proposal. +/// ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal. +pub struct ProposalExecuteMessage { + /// **message** is a json representing an sdk message passed to admin module to execute. + pub message: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +/// MsgExecuteContract defines a call to the contract execution +pub struct MsgExecuteContract { + /// **contract** is a contract address that will be called + pub contract: String, + /// **msg** is a contract call message + pub msg: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. SoftwareUpgradeProposal defines the struct for software upgrade proposal. +pub struct SoftwareUpgradeProposal { + /// **title** is a text title of proposal. Non unique. + pub title: String, + /// **description** is a text description of proposal. Non unique. + pub description: String, + /// **plan** is a plan of upgrade. + pub plan: Plan, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal. +pub struct CancelSoftwareUpgradeProposal { + /// **title** is a text title of proposal. Non unique. + pub title: String, + /// **description** is a text description of proposal. Non unique. + pub description: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. SudoContractProposal defines the struct for sudo execution proposal. pub struct SudoContractProposal { /// **title** is a text title of proposal. pub title: String, @@ -552,18 +661,66 @@ pub struct SudoContractProposal { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal. -pub struct ProposalExecuteMessage { - /// **message** is a json representing an sdk message passed to admin module to execute. - pub message: String, +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. PinCodesProposal defines the struct for pin contract codes proposal. +pub struct PinCodesProposal { + /// **title** is a text title of proposal. + pub title: String, + /// **description** is a text description of proposal. + pub description: String, + /// **code_ids** is an array of codes to be pined. + pub code_ids: Vec, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// MsgExecuteContract defines a call to the contract execution -pub struct MsgExecuteContract { - /// **contract** is a contract address that will be called +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. UnpinCodesProposal defines the struct for unpin contract codes proposal. +pub struct UnpinCodesProposal { + /// **title** is a text title of proposal. + pub title: String, + /// **description** is a text description of proposal. + pub description: String, + /// **code_ids** is an array of codes to be unpined. + pub code_ids: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. UpdateAdminProposal defines the struct for update admin proposal. +pub struct UpdateAdminProposal { + /// **title** is a text title of proposal. + pub title: String, + /// **description** is a text description of proposal. + pub description: String, + /// ***new_admin*** is an address of new admin + pub new_admin: String, + /// **contract** is an address of contract to update admin. + pub contract: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +#[deprecated( + since = "0.7.0", + note = "Will fail if used. Use MsgExecuteProposal instead" +)] +/// Deprecated. SudoContractProposal defines the struct for clear admin proposal. +pub struct ClearAdminProposal { + /// **title** is a text title of proposal. + pub title: String, + /// **description** is a text description of proposal. + pub description: String, + /// **contract** is an address of contract admin will be removed. pub contract: String, - /// **msg** is a contract call message - pub msg: String, } From ba7d2e1735c2e1638fbbc33411b75daa94763b99 Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 28 Sep 2023 15:01:52 +0400 Subject: [PATCH 25/77] improve comments --- packages/neutron-sdk/src/bindings/msg.rs | 45 ++++++++++++------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 67c529dc..9b7b807c 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -470,7 +470,7 @@ pub enum AdminProposal { /// New params has their own `MsgUpdateParams` msgs that can be supplied to `ProposalExecuteMessage` ParamChangeProposal(ParamChangeProposal), - /// Proposal to upgrade network using given `Plan` + /// Proposal to upgrade IBC client UpgradeProposal(UpgradeProposal), /// Proposal to update IBC client @@ -479,53 +479,54 @@ pub enum AdminProposal { /// Proposal to execute CosmosMsg. ProposalExecuteMessage(ProposalExecuteMessage), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to upgrade network SoftwareUpgradeProposal(SoftwareUpgradeProposal), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to cancel existing software upgrade CancelSoftwareUpgradeProposal(CancelSoftwareUpgradeProposal), /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to pin wasm contract codes PinCodesProposal(PinCodesProposal), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Deprecated. Proposal to unpin wasm contract codes. UnpinCodesProposal(UnpinCodesProposal), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to call sudo on contract. SudoContractProposal(SudoContractProposal), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to update contract admin. UpdateAdminProposal(UpdateAdminProposal), - /// Deprecated. Will fail to execute if you use it. #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] + /// Deprecated. Proposal to clear contract admin. ClearAdminProposal(ClearAdminProposal), } @@ -567,7 +568,7 @@ pub struct Plan { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -/// UpgradeProposal defines the struct for upgrade proposal. +/// UpgradeProposal defines the struct for IBC upgrade proposal. pub struct UpgradeProposal { /// **title** is a text title of proposal. pub title: String, @@ -615,7 +616,7 @@ pub struct MsgExecuteContract { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. SoftwareUpgradeProposal defines the struct for software upgrade proposal. pub struct SoftwareUpgradeProposal { @@ -631,7 +632,7 @@ pub struct SoftwareUpgradeProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal. pub struct CancelSoftwareUpgradeProposal { @@ -645,7 +646,7 @@ pub struct CancelSoftwareUpgradeProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. SudoContractProposal defines the struct for sudo execution proposal. pub struct SudoContractProposal { @@ -663,7 +664,7 @@ pub struct SudoContractProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. PinCodesProposal defines the struct for pin contract codes proposal. pub struct PinCodesProposal { @@ -679,7 +680,7 @@ pub struct PinCodesProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. UnpinCodesProposal defines the struct for unpin contract codes proposal. pub struct UnpinCodesProposal { @@ -695,7 +696,7 @@ pub struct UnpinCodesProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. UpdateAdminProposal defines the struct for update admin proposal. pub struct UpdateAdminProposal { @@ -713,7 +714,7 @@ pub struct UpdateAdminProposal { #[serde(rename_all = "snake_case")] #[deprecated( since = "0.7.0", - note = "Will fail if used. Use MsgExecuteProposal instead" + note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead" )] /// Deprecated. SudoContractProposal defines the struct for clear admin proposal. pub struct ClearAdminProposal { From 6bcda2c0c59feae2de77edaa6a5bbe159c135863 Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 28 Sep 2023 15:02:00 +0400 Subject: [PATCH 26/77] make schema --- packages/neutron-sdk/schema/neutron_msg.json | 295 ++++++++++++++++++- 1 file changed, 294 insertions(+), 1 deletion(-) diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index aba08274..32a5d4a1 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -508,6 +508,7 @@ "description": "AdminProposal defines the struct for various proposals which Neutron's Admin Module may accept.", "oneOf": [ { + "description": "Proposal to change params. Note that this works for old params. New params has their own `MsgUpdateParams` msgs that can be supplied to `ProposalExecuteMessage`", "type": "object", "required": [ "param_change_proposal" @@ -520,6 +521,7 @@ "additionalProperties": false }, { + "description": "Proposal to upgrade IBC client", "type": "object", "required": [ "upgrade_proposal" @@ -532,6 +534,7 @@ "additionalProperties": false }, { + "description": "Proposal to update IBC client", "type": "object", "required": [ "client_update_proposal" @@ -544,6 +547,7 @@ "additionalProperties": false }, { + "description": "Proposal to execute CosmosMsg.", "type": "object", "required": [ "proposal_execute_message" @@ -554,6 +558,104 @@ } }, "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to upgrade network", + "deprecated": true, + "type": "object", + "required": [ + "software_upgrade_proposal" + ], + "properties": { + "software_upgrade_proposal": { + "$ref": "#/definitions/SoftwareUpgradeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to cancel existing software upgrade", + "deprecated": true, + "type": "object", + "required": [ + "cancel_software_upgrade_proposal" + ], + "properties": { + "cancel_software_upgrade_proposal": { + "$ref": "#/definitions/CancelSoftwareUpgradeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Will fail to execute if you use it. Deprecated. Proposal to pin wasm contract codes", + "deprecated": true, + "type": "object", + "required": [ + "pin_codes_proposal" + ], + "properties": { + "pin_codes_proposal": { + "$ref": "#/definitions/PinCodesProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Deprecated. Proposal to unpin wasm contract codes.", + "deprecated": true, + "type": "object", + "required": [ + "unpin_codes_proposal" + ], + "properties": { + "unpin_codes_proposal": { + "$ref": "#/definitions/UnpinCodesProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to call sudo on contract.", + "deprecated": true, + "type": "object", + "required": [ + "sudo_contract_proposal" + ], + "properties": { + "sudo_contract_proposal": { + "$ref": "#/definitions/SudoContractProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to update contract admin.", + "deprecated": true, + "type": "object", + "required": [ + "update_admin_proposal" + ], + "properties": { + "update_admin_proposal": { + "$ref": "#/definitions/UpdateAdminProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to clear contract admin.", + "deprecated": true, + "type": "object", + "required": [ + "clear_admin_proposal" + ], + "properties": { + "clear_admin_proposal": { + "$ref": "#/definitions/ClearAdminProposal" + } + }, + "additionalProperties": false } ] }, @@ -561,6 +663,49 @@ "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, + "CancelSoftwareUpgradeProposal": { + "description": "Deprecated. CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal.", + "deprecated": true, + "type": "object", + "required": [ + "description", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal. Non unique.", + "type": "string" + } + } + }, + "ClearAdminProposal": { + "description": "Deprecated. SudoContractProposal defines the struct for clear admin proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract admin will be removed.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, "ClientUpdateProposal": { "description": "ClientUpdateProposal defines the struct for client update proposal.", "type": "object", @@ -725,6 +870,35 @@ } } }, + "PinCodesProposal": { + "description": "Deprecated. PinCodesProposal defines the struct for pin contract codes proposal.", + "deprecated": true, + "type": "object", + "required": [ + "code_ids", + "description", + "title" + ], + "properties": { + "code_ids": { + "description": "*code_ids** is an array of codes to be pined.", + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, "Plan": { "description": "Plan defines the struct for planned upgrade.", "type": "object", @@ -805,12 +979,131 @@ } } }, + "SoftwareUpgradeProposal": { + "description": "Deprecated. SoftwareUpgradeProposal defines the struct for software upgrade proposal.", + "deprecated": true, + "type": "object", + "required": [ + "description", + "plan", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "plan": { + "description": "*plan** is a plan of upgrade.", + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + }, + "title": { + "description": "*title** is a text title of proposal. Non unique.", + "type": "string" + } + } + }, + "SudoContractProposal": { + "description": "Deprecated. SudoContractProposal defines the struct for sudo execution proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "msg", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract to be executed.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "msg": { + "description": "**msg*** is a sudo message.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" }, + "UnpinCodesProposal": { + "description": "Deprecated. UnpinCodesProposal defines the struct for unpin contract codes proposal.", + "deprecated": true, + "type": "object", + "required": [ + "code_ids", + "description", + "title" + ], + "properties": { + "code_ids": { + "description": "*code_ids** is an array of codes to be unpined.", + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "UpdateAdminProposal": { + "description": "Deprecated. UpdateAdminProposal defines the struct for update admin proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "new_admin", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract to update admin.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "new_admin": { + "description": "**new_admin*** is an address of new admin", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, "UpgradeProposal": { - "description": "UpgradeProposal defines the struct for upgrade proposal.", + "description": "UpgradeProposal defines the struct for IBC upgrade proposal.", "type": "object", "required": [ "description", From 7249d5369dc04b189434de0c42d55aad6cbb61ec Mon Sep 17 00:00:00 2001 From: quasisamurai Date: Tue, 24 Oct 2023 13:58:51 +0400 Subject: [PATCH 27/77] fee optional --- packages/neutron-sdk/src/bindings/msg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 9b7b807c..d8be335c 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -40,7 +40,7 @@ pub enum NeutronMsg { interchain_account_id: String, /// **register_fee** is a fees required to be payed to register interchain account - register_fee: Vec, + register_fee: Option>, }, /// SubmitTx starts the process of executing any Cosmos-SDK *msgs* on remote chain. @@ -201,7 +201,7 @@ impl NeutronMsg { pub fn register_interchain_account( connection_id: String, interchain_account_id: String, - register_fee: Vec, + register_fee: Option>, ) -> Self { NeutronMsg::RegisterInterchainAccount { connection_id, From 276fc51e62a973d60638dc25b50e91d1bad2e1a1 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Fri, 3 Nov 2023 22:42:55 +0200 Subject: [PATCH 28/77] lint, fmt, update rust toolchain in github workflow --- .github/workflows/tests.yml | 6 ++-- contracts/ibc_transfer/src/contract.rs | 6 ++-- contracts/ibc_transfer/src/state.rs | 10 +++---- .../src/contract.rs | 30 +++++++++---------- .../src/testing/mock_querier.rs | 4 +-- .../src/testing/tests.rs | 24 +++++++-------- .../neutron_interchain_txs/src/contract.rs | 16 ++++++---- .../neutron_interchain_txs/src/storage.rs | 10 +++---- .../src/testing/tests.rs | 6 ++-- .../src/interchain_queries/v045/testing.rs | 4 +-- .../src/interchain_queries/v045/types.rs | 6 ++-- 11 files changed, 63 insertions(+), 59 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84b4f808..bfc09a8f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 1 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.68.2 + toolchain: 1.71.0 components: clippy profile: minimal override: true @@ -31,7 +31,7 @@ jobs: fetch-depth: 1 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.68.2 + toolchain: 1.71.0 components: rustfmt profile: minimal override: true @@ -49,7 +49,7 @@ jobs: fetch-depth: 1 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.68.2 + toolchain: 1.71.0 profile: minimal - run: cargo fetch --verbose - run: cargo build diff --git a/contracts/ibc_transfer/src/contract.rs b/contracts/ibc_transfer/src/contract.rs index 6afca24d..2c9ab62e 100644 --- a/contracts/ibc_transfer/src/contract.rs +++ b/contracts/ibc_transfer/src/contract.rs @@ -1,5 +1,5 @@ use cosmwasm_std::{ - coin, entry_point, from_binary, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Reply, + coin, entry_point, from_json, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, StdResult, SubMsg, }; use cw2::set_contract_version; @@ -112,8 +112,8 @@ fn msg_with_sudo_callback>, T>( // and process this payload when an acknowledgement for the SubmitTx message is received in Sudo handler fn prepare_sudo_payload(mut deps: DepsMut, _env: Env, msg: Reply) -> StdResult { let payload = read_reply_payload(deps.storage, msg.id)?; - let resp: MsgIbcTransferResponse = from_binary( - &msg.result + let resp: MsgIbcTransferResponse = from_json( + msg.result .into_result() .map_err(StdError::generic_err)? .data diff --git a/contracts/ibc_transfer/src/state.rs b/contracts/ibc_transfer/src/state.rs index 82ee71aa..cdd2a315 100644 --- a/contracts/ibc_transfer/src/state.rs +++ b/contracts/ibc_transfer/src/state.rs @@ -1,4 +1,4 @@ -use cosmwasm_std::{from_binary, to_vec, Binary, StdResult, Storage}; +use cosmwasm_std::{from_json, to_json_vec, Binary, StdResult, Storage}; use cw_storage_plus::{Item, Map}; use crate::contract::SudoPayload; @@ -28,13 +28,13 @@ pub fn get_next_id(store: &mut dyn Storage) -> StdResult { pub fn save_reply_payload(store: &mut dyn Storage, payload: SudoPayload) -> StdResult { let id = get_next_id(store)?; - REPLY_QUEUE_ID.save(store, id, &to_vec(&payload)?)?; + REPLY_QUEUE_ID.save(store, id, &to_json_vec(&payload)?)?; Ok(id) } pub fn read_reply_payload(store: &dyn Storage, id: u64) -> StdResult { let data = REPLY_QUEUE_ID.load(store, id)?; - from_binary(&Binary(data)) + from_json(Binary(data)) } /// SUDO_PAYLOAD - tmp storage for sudo handler payloads @@ -50,7 +50,7 @@ pub fn save_sudo_payload( seq_id: u64, payload: SudoPayload, ) -> StdResult<()> { - SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_vec(&payload)?) + SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_json_vec(&payload)?) } pub fn read_sudo_payload( @@ -59,5 +59,5 @@ pub fn read_sudo_payload( seq_id: u64, ) -> StdResult { let data = SUDO_PAYLOAD.load(store, (channel_id, seq_id))?; - from_binary(&Binary(data)) + from_json(Binary(data)) } diff --git a/contracts/neutron_interchain_queries/src/contract.rs b/contracts/neutron_interchain_queries/src/contract.rs index 3216ece3..9b49a41e 100644 --- a/contracts/neutron_interchain_queries/src/contract.rs +++ b/contracts/neutron_interchain_queries/src/contract.rs @@ -2,8 +2,8 @@ use cosmos_sdk_proto::cosmos::bank::v1beta1::MsgSend; use cosmos_sdk_proto::cosmos::tx::v1beta1::{TxBody, TxRaw}; use cosmos_sdk_proto::traits::Message; use cosmwasm_std::{ - entry_point, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult, - Uint128, + entry_point, to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, + StdResult, Uint128, }; use cw2::set_contract_version; @@ -250,27 +250,27 @@ pub fn remove_interchain_query(query_id: u64) -> NeutronResult, env: Env, msg: QueryMsg) -> NeutronResult { match msg { //TODO: check if query.result.height is too old (for all interchain queries) - QueryMsg::Balance { query_id } => Ok(to_binary(&query_balance(deps, env, query_id)?)?), + QueryMsg::Balance { query_id } => Ok(to_json_binary(&query_balance(deps, env, query_id)?)?), QueryMsg::BankTotalSupply { query_id } => { - Ok(to_binary(&query_bank_total(deps, env, query_id)?)?) + Ok(to_json_binary(&query_bank_total(deps, env, query_id)?)?) } - QueryMsg::DistributionFeePool { query_id } => Ok(to_binary(&query_distribution_fee_pool( - deps, env, query_id, - )?)?), - QueryMsg::StakingValidators { query_id } => { - Ok(to_binary(&query_staking_validators(deps, env, query_id)?)?) - } - QueryMsg::GovernmentProposals { query_id } => Ok(to_binary(&query_government_proposals( + QueryMsg::DistributionFeePool { query_id } => Ok(to_json_binary( + &query_distribution_fee_pool(deps, env, query_id)?, + )?), + QueryMsg::StakingValidators { query_id } => Ok(to_json_binary(&query_staking_validators( deps, env, query_id, )?)?), + QueryMsg::GovernmentProposals { query_id } => Ok(to_json_binary( + &query_government_proposals(deps, env, query_id)?, + )?), QueryMsg::GetDelegations { query_id } => { - Ok(to_binary(&query_delegations(deps, env, query_id)?)?) + Ok(to_json_binary(&query_delegations(deps, env, query_id)?)?) } QueryMsg::Cw20Balance { query_id } => { - Ok(to_binary(&query_cw20_balance(deps, env, query_id)?)?) + Ok(to_json_binary(&query_cw20_balance(deps, env, query_id)?)?) } QueryMsg::GetRegisteredQuery { query_id } => { - Ok(to_binary(&get_registered_query(deps, query_id)?)?) + Ok(to_json_binary(&get_registered_query(deps, query_id)?)?) } QueryMsg::GetRecipientTxs { recipient } => query_recipient_txs(deps, recipient), } @@ -280,7 +280,7 @@ fn query_recipient_txs(deps: Deps, recipient: String) -> NeutronRe let txs = RECIPIENT_TXS .load(deps.storage, &recipient) .unwrap_or_default(); - Ok(to_binary(&GetRecipientTxsResponse { transfers: txs })?) + Ok(to_json_binary(&GetRecipientTxsResponse { transfers: txs })?) } pub fn query_cw20_balance( diff --git a/contracts/neutron_interchain_queries/src/testing/mock_querier.rs b/contracts/neutron_interchain_queries/src/testing/mock_querier.rs index e57382a3..b82c8b94 100644 --- a/contracts/neutron_interchain_queries/src/testing/mock_querier.rs +++ b/contracts/neutron_interchain_queries/src/testing/mock_querier.rs @@ -3,7 +3,7 @@ use std::marker::PhantomData; use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage}; use cosmwasm_std::{ - from_slice, Binary, Coin, ContractResult, CustomQuery, FullDelegation, OwnedDeps, Querier, + from_json, Binary, Coin, ContractResult, CustomQuery, FullDelegation, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, Validator, }; use schemars::JsonSchema; @@ -43,7 +43,7 @@ pub struct WasmMockQuerier { impl Querier for WasmMockQuerier { fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { - let request: QueryRequest = match from_slice(bin_request) { + let request: QueryRequest = match from_json(bin_request) { Ok(v) => v, Err(e) => { return QuerierResult::Err(SystemError::InvalidRequest { diff --git a/contracts/neutron_interchain_queries/src/testing/tests.rs b/contracts/neutron_interchain_queries/src/testing/tests.rs index fdd34cf2..1bc4f421 100644 --- a/contracts/neutron_interchain_queries/src/testing/tests.rs +++ b/contracts/neutron_interchain_queries/src/testing/tests.rs @@ -16,8 +16,8 @@ use cosmos_sdk_proto::traits::Message; use cosmos_sdk_proto::Any; use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockStorage}; use cosmwasm_std::{ - from_binary, to_binary, Addr, Binary, Coin, Decimal, Delegation, Env, MessageInfo, OwnedDeps, - StdError, Uint128, + from_json, to_json_binary, Addr, Binary, Coin, Decimal, Delegation, Env, MessageInfo, + OwnedDeps, StdError, Uint128, }; use neutron_sdk::bindings::query::{ NeutronQuery, QueryRegisteredQueryResponse, QueryRegisteredQueryResultResponse, @@ -257,7 +257,7 @@ fn test_query_balance() { ); let query_balance = QueryMsg::Balance { query_id: 1 }; let resp: BalanceResponse = - from_binary(&query(deps.as_ref(), mock_env(), query_balance).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), query_balance).unwrap()).unwrap(); assert_eq!( resp, BalanceResponse { @@ -304,11 +304,11 @@ fn test_bank_total_supply_query() { deps.querier.add_registered_queries(1, registered_query); deps.querier - .add_query_response(1, to_binary(&total_supply_response).unwrap()); + .add_query_response(1, to_json_binary(&total_supply_response).unwrap()); let bank_total_balance = QueryMsg::BankTotalSupply { query_id: 1 }; let resp: TotalSupplyResponse = - from_binary(&query(deps.as_ref(), mock_env(), bank_total_balance).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), bank_total_balance).unwrap()).unwrap(); assert_eq!( resp, TotalSupplyResponse { @@ -347,7 +347,7 @@ fn test_distribution_fee_pool_query() { ); let fee_pool_balance = QueryMsg::DistributionFeePool { query_id: 1 }; let resp: FeePoolResponse = - from_binary(&query(deps.as_ref(), mock_env(), fee_pool_balance).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), fee_pool_balance).unwrap()).unwrap(); assert_eq!( resp, FeePoolResponse { @@ -393,11 +393,11 @@ fn test_gov_proposals_query() { deps.querier.add_registered_queries(1, registered_query); deps.querier - .add_query_response(1, to_binary(&proposals_response).unwrap()); + .add_query_response(1, to_json_binary(&proposals_response).unwrap()); let government_proposal = QueryMsg::GovernmentProposals { query_id: 1 }; let resp: ProposalResponse = - from_binary(&query(deps.as_ref(), mock_env(), government_proposal).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), government_proposal).unwrap()).unwrap(); assert_eq!( resp, ProposalResponse { @@ -503,10 +503,10 @@ fn test_staking_validators_query() { deps.querier.add_registered_queries(1, registered_query); deps.querier - .add_query_response(1, to_binary(&validators_response).unwrap()); + .add_query_response(1, to_json_binary(&validators_response).unwrap()); let staking_validators = QueryMsg::StakingValidators { query_id: 1 }; let resp: ValidatorResponse = - from_binary(&query(deps.as_ref(), mock_env(), staking_validators).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), staking_validators).unwrap()).unwrap(); assert_eq!( resp, ValidatorResponse { @@ -649,12 +649,12 @@ fn test_query_delegator_delegations() { build_registered_query_response(1, QueryParam::Keys(keys.0), QueryType::KV, 987); deps.querier - .add_query_response(1, to_binary(&delegations_response).unwrap()); + .add_query_response(1, to_json_binary(&delegations_response).unwrap()); deps.querier.add_registered_queries(1, registered_query); let query_delegations = QueryMsg::GetDelegations { query_id: 1 }; let resp: DelegatorDelegationsResponse = - from_binary(&query(deps.as_ref(), mock_env(), query_delegations).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), query_delegations).unwrap()).unwrap(); assert_eq!( resp, diff --git a/contracts/neutron_interchain_txs/src/contract.rs b/contracts/neutron_interchain_txs/src/contract.rs index 14e793d1..6823589e 100644 --- a/contracts/neutron_interchain_txs/src/contract.rs +++ b/contracts/neutron_interchain_txs/src/contract.rs @@ -6,8 +6,8 @@ use cosmos_sdk_proto::traits::Message; #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - to_binary, Binary, Coin as CoinSDK, CosmosMsg, CustomQuery, Deps, DepsMut, Env, MessageInfo, - Reply, Response, StdError, StdResult, SubMsg, + to_json_binary, Binary, Coin as CoinSDK, CosmosMsg, CustomQuery, Deps, DepsMut, Env, + MessageInfo, Reply, Response, StdError, StdResult, SubMsg, }; use cw2::set_contract_version; use schemars::JsonSchema; @@ -151,7 +151,7 @@ pub fn query_interchain_address( }; let res: QueryInterchainAccountAddressResponse = deps.querier.query(&query.into())?; - Ok(to_binary(&res)?) + Ok(to_json_binary(&res)?) } // returns ICA address from the contract storage. The address was saved in sudo_open_ack method @@ -160,7 +160,11 @@ pub fn query_interchain_address_contract( env: Env, interchain_account_id: String, ) -> NeutronResult { - Ok(to_binary(&get_ica(deps, &env, &interchain_account_id)?)?) + Ok(to_json_binary(&get_ica( + deps, + &env, + &interchain_account_id, + )?)?) } // returns the result @@ -172,12 +176,12 @@ pub fn query_acknowledgement_result( ) -> NeutronResult { let port_id = get_port_id(env.contract.address.as_str(), &interchain_account_id); let res = ACKNOWLEDGEMENT_RESULTS.may_load(deps.storage, (port_id, sequence_id))?; - Ok(to_binary(&res)?) + Ok(to_json_binary(&res)?) } pub fn query_errors_queue(deps: Deps) -> NeutronResult { let res = read_errors_from_queue(deps.storage)?; - Ok(to_binary(&res)?) + Ok(to_json_binary(&res)?) } // saves payload to process later to the storage and returns a SubmitTX Cosmos SubMsg with necessary reply id diff --git a/contracts/neutron_interchain_txs/src/storage.rs b/contracts/neutron_interchain_txs/src/storage.rs index 27a7eeea..ea4687d1 100644 --- a/contracts/neutron_interchain_txs/src/storage.rs +++ b/contracts/neutron_interchain_txs/src/storage.rs @@ -1,4 +1,4 @@ -use cosmwasm_std::{from_binary, to_vec, Binary, Order, StdResult, Storage}; +use cosmwasm_std::{from_json, to_json_vec, Binary, Order, StdResult, Storage}; use cw_storage_plus::{Item, Map}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -38,12 +38,12 @@ pub enum AcknowledgementResult { } pub fn save_reply_payload(store: &mut dyn Storage, payload: SudoPayload) -> StdResult<()> { - REPLY_ID_STORAGE.save(store, &to_vec(&payload)?) + REPLY_ID_STORAGE.save(store, &to_json_vec(&payload)?) } pub fn read_reply_payload(store: &dyn Storage) -> StdResult { let data = REPLY_ID_STORAGE.load(store)?; - from_binary(&Binary(data)) + from_json(Binary(data)) } pub fn add_error_to_queue(store: &mut dyn Storage, error_msg: String) -> Option<()> { @@ -69,7 +69,7 @@ pub fn read_sudo_payload( seq_id: u64, ) -> StdResult { let data = SUDO_PAYLOAD.load(store, (channel_id, seq_id))?; - from_binary(&Binary(data)) + from_json(Binary(data)) } pub fn save_sudo_payload( @@ -78,5 +78,5 @@ pub fn save_sudo_payload( seq_id: u64, payload: SudoPayload, ) -> StdResult<()> { - SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_vec(&payload)?) + SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_json_vec(&payload)?) } diff --git a/contracts/neutron_interchain_txs/src/testing/tests.rs b/contracts/neutron_interchain_txs/src/testing/tests.rs index ab57cb8b..de11aad6 100644 --- a/contracts/neutron_interchain_txs/src/testing/tests.rs +++ b/contracts/neutron_interchain_txs/src/testing/tests.rs @@ -6,7 +6,7 @@ use crate::{ }; use cosmwasm_std::{ - from_binary, + from_json, testing::{MockApi, MockQuerier, MockStorage}, OwnedDeps, }; @@ -27,7 +27,7 @@ fn test_query_errors_queue() { let mut deps = mock_dependencies(); let result = query_errors_queue(deps.as_ref()).unwrap(); - let result: Vec<(Vec, String)> = from_binary(&result).unwrap(); + let result: Vec<(Vec, String)> = from_json(result).unwrap(); assert_eq!(0, result.len()); @@ -38,7 +38,7 @@ fn test_query_errors_queue() { .unwrap(); let result = query_errors_queue(deps.as_ref()).unwrap(); - let result: Vec<(Vec, String)> = from_binary(&result).unwrap(); + let result: Vec<(Vec, String)> = from_json(result).unwrap(); assert_eq!(1, result.len()); } diff --git a/packages/neutron-sdk/src/interchain_queries/v045/testing.rs b/packages/neutron-sdk/src/interchain_queries/v045/testing.rs index bfcacc36..db7abbae 100644 --- a/packages/neutron-sdk/src/interchain_queries/v045/testing.rs +++ b/packages/neutron-sdk/src/interchain_queries/v045/testing.rs @@ -22,7 +22,7 @@ use cosmos_sdk_proto::cosmos::staking::v1beta1::{ }; use cosmos_sdk_proto::traits::Message; use cosmwasm_std::{ - to_binary, Addr, Binary, Coin as StdCoin, Decimal, Delegation as StdDelegation, Uint128, + to_json_binary, Addr, Binary, Coin as StdCoin, Decimal, Delegation as StdDelegation, Uint128, }; use hex; use std::ops::Mul; @@ -728,7 +728,7 @@ fn test_delegations_reconstruct() { if ts.stake_denom.is_empty() { return Default::default(); } - to_binary(&ts.stake_denom).unwrap() + to_json_binary(&ts.stake_denom).unwrap() }, }]; diff --git a/packages/neutron-sdk/src/interchain_queries/v045/types.rs b/packages/neutron-sdk/src/interchain_queries/v045/types.rs index 072565d0..24555633 100644 --- a/packages/neutron-sdk/src/interchain_queries/v045/types.rs +++ b/packages/neutron-sdk/src/interchain_queries/v045/types.rs @@ -10,7 +10,7 @@ use cosmos_sdk_proto::cosmos::{ staking::v1beta1::{Delegation, Validator as CosmosValidator}, }; use cosmos_sdk_proto::traits::Message; -use cosmwasm_std::{from_binary, Addr, Coin, Decimal, StdError, Uint128}; +use cosmwasm_std::{from_json, Addr, Coin, Decimal, StdError, Uint128}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::{ops::Div, str::FromStr}; @@ -87,7 +87,7 @@ impl KVReconstruct for Uint128 { let value = storage_values .first() .ok_or_else(|| StdError::generic_err("empty query result"))?; - let balance: Uint128 = from_binary(&value.value)?; + let balance: Uint128 = from_json(&value.value)?; Ok(balance) } } @@ -348,7 +348,7 @@ impl KVReconstruct for Delegations { "denom is empty".into(), )); } - let denom: String = from_binary(&storage_values[0].value)?; + let denom: String = from_json(&storage_values[0].value)?; // the rest are delegations and validators alternately for chunk in storage_values[1..].chunks(2) { From 6858ccdeba4255d2d2b725b12e3a5d08eb221bc2 Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 16 Nov 2023 16:25:41 +0400 Subject: [PATCH 29/77] dex proto types --- build_proto.sh | 6 +- packages/neutron-sdk/src/proto_types/bank.rs | 1378 ++++++++ .../neutron-sdk/src/proto_types/cosmos.rs | 585 ++++ .../src/proto_types/deposit_record.rs | 308 ++ packages/neutron-sdk/src/proto_types/gogo.rs | 600 ++++ .../src/proto_types/limit_order_expiration.rs | 221 ++ .../src/proto_types/limit_order_tranche.rs | 550 +++ .../proto_types/limit_order_tranche_user.rs | 366 ++ packages/neutron-sdk/src/proto_types/mod.rs | 15 + .../neutron-sdk/src/proto_types/pair_id.rs | 210 ++ .../neutron-sdk/src/proto_types/params.rs | 198 ++ packages/neutron-sdk/src/proto_types/pool.rs | 241 ++ .../src/proto_types/pool_metadata.rs | 256 ++ .../src/proto_types/pool_reserves.rs | 452 +++ .../src/proto_types/tick_liquidity.rs | 358 ++ .../src/proto_types/trade_pair_id.rs | 211 ++ .../neutron-sdk/src/proto_types/transfer.rs | 10 +- packages/neutron-sdk/src/proto_types/tx.rs | 3002 +++++++++++++++++ proto/amino.proto | 79 + proto/amino/amino.proto | 79 + .../cosmos/app/runtime/v1alpha1/module.proto | 50 + proto/cosmos/app/v1alpha1/config.proto | 55 + proto/cosmos/app/v1alpha1/module.proto | 91 + proto/cosmos/app/v1alpha1/query.proto | 22 + proto/cosmos/auth/module/v1/module.proto | 31 + proto/cosmos/auth/v1beta1/auth.proto | 58 + proto/cosmos/auth/v1beta1/genesis.proto | 18 + proto/cosmos/auth/v1beta1/query.proto | 236 ++ proto/cosmos/auth/v1beta1/tx.proto | 43 + proto/cosmos/authz/module/v1/module.proto | 12 + proto/cosmos/authz/v1beta1/authz.proto | 48 + proto/cosmos/authz/v1beta1/event.proto | 27 + proto/cosmos/authz/v1beta1/genesis.proto | 14 + proto/cosmos/authz/v1beta1/query.proto | 82 + proto/cosmos/authz/v1beta1/tx.proto | 81 + proto/cosmos/autocli/v1/options.proto | 127 + proto/cosmos/autocli/v1/query.proto | 28 + proto/cosmos/bank/module/v1/module.proto | 20 + proto/cosmos/bank/v1beta1/authz.proto | 30 + proto/cosmos/bank/v1beta1/bank.proto | 124 + proto/cosmos/bank/v1beta1/genesis.proto | 52 + proto/cosmos/bank/v1beta1/query.proto | 348 ++ proto/cosmos/bank/v1beta1/tx.proto | 122 + proto/cosmos/base/abci/v1beta1/abci.proto | 158 + proto/cosmos/base/kv/v1beta1/kv.proto | 17 + proto/cosmos/base/node/v1beta1/query.proto | 22 + .../base/query/v1beta1/pagination.proto | 56 + .../base/reflection/v1beta1/reflection.proto | 44 + .../base/reflection/v2alpha1/reflection.proto | 218 ++ .../base/snapshots/v1beta1/snapshot.proto | 90 + .../base/store/v1beta1/commit_info.proto | 32 + .../cosmos/base/store/v1beta1/listening.proto | 34 + .../base/tendermint/v1beta1/query.proto | 208 ++ .../base/tendermint/v1beta1/types.proto | 52 + proto/cosmos/base/v1beta1/coin.proto | 48 + .../cosmos/capability/module/v1/module.proto | 16 + .../capability/v1beta1/capability.proto | 31 + proto/cosmos/capability/v1beta1/genesis.proto | 27 + proto/cosmos/consensus/module/v1/module.proto | 15 + proto/cosmos/consensus/v1/query.proto | 27 + proto/cosmos/consensus/v1/tx.proto | 39 + proto/cosmos/crisis/module/v1/module.proto | 18 + proto/cosmos/crisis/v1beta1/genesis.proto | 15 + proto/cosmos/crisis/v1beta1/tx.proto | 65 + proto/cosmos/crypto/ed25519/keys.proto | 39 + proto/cosmos/crypto/hd/v1/hd.proto | 27 + proto/cosmos/crypto/keyring/v1/record.proto | 48 + proto/cosmos/crypto/multisig/keys.proto | 30 + .../crypto/multisig/v1beta1/multisig.proto | 25 + proto/cosmos/crypto/secp256k1/keys.proto | 38 + proto/cosmos/crypto/secp256r1/keys.proto | 23 + .../distribution/module/v1/module.proto | 17 + .../distribution/v1beta1/distribution.proto | 194 ++ .../cosmos/distribution/v1beta1/genesis.proto | 155 + proto/cosmos/distribution/v1beta1/query.proto | 256 ++ proto/cosmos/distribution/v1beta1/tx.proto | 178 + proto/cosmos/evidence/module/v1/module.proto | 12 + proto/cosmos/evidence/v1beta1/evidence.proto | 32 + proto/cosmos/evidence/v1beta1/genesis.proto | 12 + proto/cosmos/evidence/v1beta1/query.proto | 58 + proto/cosmos/evidence/v1beta1/tx.proto | 42 + proto/cosmos/feegrant/module/v1/module.proto | 12 + proto/cosmos/feegrant/v1beta1/feegrant.proto | 93 + proto/cosmos/feegrant/v1beta1/genesis.proto | 14 + proto/cosmos/feegrant/v1beta1/query.proto | 84 + proto/cosmos/feegrant/v1beta1/tx.proto | 57 + proto/cosmos/genutil/module/v1/module.proto | 12 + proto/cosmos/genutil/v1beta1/genesis.proto | 18 + proto/cosmos/gov/module/v1/module.proto | 19 + proto/cosmos/gov/v1/genesis.proto | 33 + proto/cosmos/gov/v1/gov.proto | 220 ++ proto/cosmos/gov/v1/query.proto | 193 ++ proto/cosmos/gov/v1/tx.proto | 172 + proto/cosmos/gov/v1beta1/genesis.proto | 30 + proto/cosmos/gov/v1beta1/gov.proto | 252 ++ proto/cosmos/gov/v1beta1/query.proto | 194 ++ proto/cosmos/gov/v1beta1/tx.proto | 138 + proto/cosmos/group/module/v1/module.proto | 24 + proto/cosmos/group/v1/events.proto | 94 + proto/cosmos/group/v1/genesis.proto | 39 + proto/cosmos/group/v1/query.proto | 320 ++ proto/cosmos/group/v1/tx.proto | 394 +++ proto/cosmos/group/v1/types.proto | 337 ++ proto/cosmos/mint/module/v1/module.proto | 17 + proto/cosmos/mint/v1beta1/genesis.proto | 17 + proto/cosmos/mint/v1beta1/mint.proto | 59 + proto/cosmos/mint/v1beta1/query.proto | 65 + proto/cosmos/mint/v1beta1/tx.proto | 43 + proto/cosmos/msg/v1/msg.proto | 30 + proto/cosmos/nft/module/v1/module.proto | 12 + proto/cosmos/nft/v1beta1/event.proto | 43 + proto/cosmos/nft/v1beta1/genesis.proto | 24 + proto/cosmos/nft/v1beta1/nft.proto | 48 + proto/cosmos/nft/v1beta1/query.proto | 152 + proto/cosmos/nft/v1beta1/tx.proto | 34 + proto/cosmos/orm/module/v1alpha1/module.proto | 14 + proto/cosmos/orm/query/v1alpha1/query.proto | 131 + proto/cosmos/orm/v1/orm.proto | 104 + proto/cosmos/orm/v1alpha1/schema.proto | 76 + proto/cosmos/params/module/v1/module.proto | 12 + proto/cosmos/params/v1beta1/params.proto | 31 + proto/cosmos/params/v1beta1/query.proto | 63 + proto/cosmos/query/v1/query.proto | 35 + proto/cosmos/reflection/v1/reflection.proto | 27 + proto/cosmos/slashing/module/v1/module.proto | 15 + proto/cosmos/slashing/v1beta1/genesis.proto | 48 + proto/cosmos/slashing/v1beta1/query.proto | 66 + proto/cosmos/slashing/v1beta1/slashing.proto | 59 + proto/cosmos/slashing/v1beta1/tx.proto | 68 + proto/cosmos/staking/module/v1/module.proto | 20 + proto/cosmos/staking/v1beta1/authz.proto | 49 + proto/cosmos/staking/v1beta1/genesis.proto | 53 + proto/cosmos/staking/v1beta1/query.proto | 387 +++ proto/cosmos/staking/v1beta1/staking.proto | 405 +++ proto/cosmos/staking/v1beta1/tx.proto | 201 ++ proto/cosmos/tx/config/v1/config.proto | 20 + proto/cosmos/tx/signing/v1beta1/signing.proto | 106 + proto/cosmos/tx/v1beta1/service.proto | 277 ++ proto/cosmos/tx/v1beta1/tx.proto | 256 ++ proto/cosmos/upgrade/module/v1/module.proto | 15 + proto/cosmos/upgrade/v1beta1/query.proto | 122 + proto/cosmos/upgrade/v1beta1/tx.proto | 62 + proto/cosmos/upgrade/v1beta1/upgrade.proto | 98 + proto/cosmos/vesting/module/v1/module.proto | 12 + proto/cosmos/vesting/v1beta1/tx.proto | 100 + proto/cosmos/vesting/v1beta1/vesting.proto | 97 + proto/cosmos_proto/cosmos.proto | 97 + proto/gogoproto/gogo.proto | 145 + proto/neutron/dex/deposit_record.proto | 20 + .../neutron/dex/limit_order_expiration.proto | 18 + proto/neutron/dex/limit_order_tranche.proto | 60 + .../dex/limit_order_tranche_user.proto | 34 + proto/neutron/dex/pair_id.proto | 9 + proto/neutron/dex/params.proto | 12 + proto/neutron/dex/pool.proto | 14 + proto/neutron/dex/pool_metadata.proto | 13 + proto/neutron/dex/pool_reserves.proto | 35 + proto/neutron/dex/tick_liquidity.proto | 17 + proto/neutron/dex/trade_pair_id.proto | 9 + proto/neutron/dex/tx.proto | 209 ++ proto/transfer/v1/transfer.proto | 2 +- 161 files changed, 20271 insertions(+), 7 deletions(-) create mode 100644 packages/neutron-sdk/src/proto_types/bank.rs create mode 100644 packages/neutron-sdk/src/proto_types/cosmos.rs create mode 100644 packages/neutron-sdk/src/proto_types/deposit_record.rs create mode 100644 packages/neutron-sdk/src/proto_types/gogo.rs create mode 100644 packages/neutron-sdk/src/proto_types/limit_order_expiration.rs create mode 100644 packages/neutron-sdk/src/proto_types/limit_order_tranche.rs create mode 100644 packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs create mode 100644 packages/neutron-sdk/src/proto_types/pair_id.rs create mode 100644 packages/neutron-sdk/src/proto_types/params.rs create mode 100644 packages/neutron-sdk/src/proto_types/pool.rs create mode 100644 packages/neutron-sdk/src/proto_types/pool_metadata.rs create mode 100644 packages/neutron-sdk/src/proto_types/pool_reserves.rs create mode 100644 packages/neutron-sdk/src/proto_types/tick_liquidity.rs create mode 100644 packages/neutron-sdk/src/proto_types/trade_pair_id.rs create mode 100644 packages/neutron-sdk/src/proto_types/tx.rs create mode 100644 proto/amino.proto create mode 100644 proto/amino/amino.proto create mode 100644 proto/cosmos/app/runtime/v1alpha1/module.proto create mode 100644 proto/cosmos/app/v1alpha1/config.proto create mode 100644 proto/cosmos/app/v1alpha1/module.proto create mode 100644 proto/cosmos/app/v1alpha1/query.proto create mode 100644 proto/cosmos/auth/module/v1/module.proto create mode 100644 proto/cosmos/auth/v1beta1/auth.proto create mode 100644 proto/cosmos/auth/v1beta1/genesis.proto create mode 100644 proto/cosmos/auth/v1beta1/query.proto create mode 100644 proto/cosmos/auth/v1beta1/tx.proto create mode 100644 proto/cosmos/authz/module/v1/module.proto create mode 100644 proto/cosmos/authz/v1beta1/authz.proto create mode 100644 proto/cosmos/authz/v1beta1/event.proto create mode 100644 proto/cosmos/authz/v1beta1/genesis.proto create mode 100644 proto/cosmos/authz/v1beta1/query.proto create mode 100644 proto/cosmos/authz/v1beta1/tx.proto create mode 100644 proto/cosmos/autocli/v1/options.proto create mode 100644 proto/cosmos/autocli/v1/query.proto create mode 100644 proto/cosmos/bank/module/v1/module.proto create mode 100644 proto/cosmos/bank/v1beta1/authz.proto create mode 100644 proto/cosmos/bank/v1beta1/bank.proto create mode 100644 proto/cosmos/bank/v1beta1/genesis.proto create mode 100644 proto/cosmos/bank/v1beta1/query.proto create mode 100644 proto/cosmos/bank/v1beta1/tx.proto create mode 100644 proto/cosmos/base/abci/v1beta1/abci.proto create mode 100644 proto/cosmos/base/kv/v1beta1/kv.proto create mode 100644 proto/cosmos/base/node/v1beta1/query.proto create mode 100644 proto/cosmos/base/query/v1beta1/pagination.proto create mode 100644 proto/cosmos/base/reflection/v1beta1/reflection.proto create mode 100644 proto/cosmos/base/reflection/v2alpha1/reflection.proto create mode 100644 proto/cosmos/base/snapshots/v1beta1/snapshot.proto create mode 100644 proto/cosmos/base/store/v1beta1/commit_info.proto create mode 100644 proto/cosmos/base/store/v1beta1/listening.proto create mode 100644 proto/cosmos/base/tendermint/v1beta1/query.proto create mode 100644 proto/cosmos/base/tendermint/v1beta1/types.proto create mode 100644 proto/cosmos/base/v1beta1/coin.proto create mode 100644 proto/cosmos/capability/module/v1/module.proto create mode 100644 proto/cosmos/capability/v1beta1/capability.proto create mode 100644 proto/cosmos/capability/v1beta1/genesis.proto create mode 100644 proto/cosmos/consensus/module/v1/module.proto create mode 100644 proto/cosmos/consensus/v1/query.proto create mode 100644 proto/cosmos/consensus/v1/tx.proto create mode 100644 proto/cosmos/crisis/module/v1/module.proto create mode 100644 proto/cosmos/crisis/v1beta1/genesis.proto create mode 100644 proto/cosmos/crisis/v1beta1/tx.proto create mode 100644 proto/cosmos/crypto/ed25519/keys.proto create mode 100644 proto/cosmos/crypto/hd/v1/hd.proto create mode 100644 proto/cosmos/crypto/keyring/v1/record.proto create mode 100644 proto/cosmos/crypto/multisig/keys.proto create mode 100644 proto/cosmos/crypto/multisig/v1beta1/multisig.proto create mode 100644 proto/cosmos/crypto/secp256k1/keys.proto create mode 100644 proto/cosmos/crypto/secp256r1/keys.proto create mode 100644 proto/cosmos/distribution/module/v1/module.proto create mode 100644 proto/cosmos/distribution/v1beta1/distribution.proto create mode 100644 proto/cosmos/distribution/v1beta1/genesis.proto create mode 100644 proto/cosmos/distribution/v1beta1/query.proto create mode 100644 proto/cosmos/distribution/v1beta1/tx.proto create mode 100644 proto/cosmos/evidence/module/v1/module.proto create mode 100644 proto/cosmos/evidence/v1beta1/evidence.proto create mode 100644 proto/cosmos/evidence/v1beta1/genesis.proto create mode 100644 proto/cosmos/evidence/v1beta1/query.proto create mode 100644 proto/cosmos/evidence/v1beta1/tx.proto create mode 100644 proto/cosmos/feegrant/module/v1/module.proto create mode 100644 proto/cosmos/feegrant/v1beta1/feegrant.proto create mode 100644 proto/cosmos/feegrant/v1beta1/genesis.proto create mode 100644 proto/cosmos/feegrant/v1beta1/query.proto create mode 100644 proto/cosmos/feegrant/v1beta1/tx.proto create mode 100644 proto/cosmos/genutil/module/v1/module.proto create mode 100644 proto/cosmos/genutil/v1beta1/genesis.proto create mode 100644 proto/cosmos/gov/module/v1/module.proto create mode 100644 proto/cosmos/gov/v1/genesis.proto create mode 100644 proto/cosmos/gov/v1/gov.proto create mode 100644 proto/cosmos/gov/v1/query.proto create mode 100644 proto/cosmos/gov/v1/tx.proto create mode 100644 proto/cosmos/gov/v1beta1/genesis.proto create mode 100644 proto/cosmos/gov/v1beta1/gov.proto create mode 100644 proto/cosmos/gov/v1beta1/query.proto create mode 100644 proto/cosmos/gov/v1beta1/tx.proto create mode 100644 proto/cosmos/group/module/v1/module.proto create mode 100644 proto/cosmos/group/v1/events.proto create mode 100644 proto/cosmos/group/v1/genesis.proto create mode 100644 proto/cosmos/group/v1/query.proto create mode 100644 proto/cosmos/group/v1/tx.proto create mode 100644 proto/cosmos/group/v1/types.proto create mode 100644 proto/cosmos/mint/module/v1/module.proto create mode 100644 proto/cosmos/mint/v1beta1/genesis.proto create mode 100644 proto/cosmos/mint/v1beta1/mint.proto create mode 100644 proto/cosmos/mint/v1beta1/query.proto create mode 100644 proto/cosmos/mint/v1beta1/tx.proto create mode 100644 proto/cosmos/msg/v1/msg.proto create mode 100644 proto/cosmos/nft/module/v1/module.proto create mode 100644 proto/cosmos/nft/v1beta1/event.proto create mode 100644 proto/cosmos/nft/v1beta1/genesis.proto create mode 100644 proto/cosmos/nft/v1beta1/nft.proto create mode 100644 proto/cosmos/nft/v1beta1/query.proto create mode 100644 proto/cosmos/nft/v1beta1/tx.proto create mode 100644 proto/cosmos/orm/module/v1alpha1/module.proto create mode 100644 proto/cosmos/orm/query/v1alpha1/query.proto create mode 100644 proto/cosmos/orm/v1/orm.proto create mode 100644 proto/cosmos/orm/v1alpha1/schema.proto create mode 100644 proto/cosmos/params/module/v1/module.proto create mode 100644 proto/cosmos/params/v1beta1/params.proto create mode 100644 proto/cosmos/params/v1beta1/query.proto create mode 100644 proto/cosmos/query/v1/query.proto create mode 100644 proto/cosmos/reflection/v1/reflection.proto create mode 100644 proto/cosmos/slashing/module/v1/module.proto create mode 100644 proto/cosmos/slashing/v1beta1/genesis.proto create mode 100644 proto/cosmos/slashing/v1beta1/query.proto create mode 100644 proto/cosmos/slashing/v1beta1/slashing.proto create mode 100644 proto/cosmos/slashing/v1beta1/tx.proto create mode 100644 proto/cosmos/staking/module/v1/module.proto create mode 100644 proto/cosmos/staking/v1beta1/authz.proto create mode 100644 proto/cosmos/staking/v1beta1/genesis.proto create mode 100644 proto/cosmos/staking/v1beta1/query.proto create mode 100644 proto/cosmos/staking/v1beta1/staking.proto create mode 100644 proto/cosmos/staking/v1beta1/tx.proto create mode 100644 proto/cosmos/tx/config/v1/config.proto create mode 100644 proto/cosmos/tx/signing/v1beta1/signing.proto create mode 100644 proto/cosmos/tx/v1beta1/service.proto create mode 100644 proto/cosmos/tx/v1beta1/tx.proto create mode 100644 proto/cosmos/upgrade/module/v1/module.proto create mode 100644 proto/cosmos/upgrade/v1beta1/query.proto create mode 100644 proto/cosmos/upgrade/v1beta1/tx.proto create mode 100644 proto/cosmos/upgrade/v1beta1/upgrade.proto create mode 100644 proto/cosmos/vesting/module/v1/module.proto create mode 100644 proto/cosmos/vesting/v1beta1/tx.proto create mode 100644 proto/cosmos/vesting/v1beta1/vesting.proto create mode 100644 proto/cosmos_proto/cosmos.proto create mode 100644 proto/gogoproto/gogo.proto create mode 100644 proto/neutron/dex/deposit_record.proto create mode 100644 proto/neutron/dex/limit_order_expiration.proto create mode 100644 proto/neutron/dex/limit_order_tranche.proto create mode 100644 proto/neutron/dex/limit_order_tranche_user.proto create mode 100644 proto/neutron/dex/pair_id.proto create mode 100644 proto/neutron/dex/params.proto create mode 100644 proto/neutron/dex/pool.proto create mode 100644 proto/neutron/dex/pool_metadata.proto create mode 100644 proto/neutron/dex/pool_reserves.proto create mode 100644 proto/neutron/dex/tick_liquidity.proto create mode 100644 proto/neutron/dex/trade_pair_id.proto create mode 100644 proto/neutron/dex/tx.proto diff --git a/build_proto.sh b/build_proto.sh index b8d4a220..60085ea2 100755 --- a/build_proto.sh +++ b/build_proto.sh @@ -4,5 +4,9 @@ docker run --rm \ -v $PWD:/opt \ protoc_builder sh -c "protoc \ -I/opt/proto \ +/opt/proto/gogoproto/*.proto \ +/opt/proto/cosmos_proto/*.proto \ +/opt/proto/cosmos/bank/v1beta1/bank.proto \ /opt/proto/transfer/v1/*.proto \ ---rust_out /opt/packages/neutron-sdk/src/proto_types/" \ No newline at end of file +/opt/proto/neutron/dex/*.proto \ +--rust_out /opt/packages/neutron-sdk/src/proto_types/" diff --git a/packages/neutron-sdk/src/proto_types/bank.rs b/packages/neutron-sdk/src/proto_types/bank.rs new file mode 100644 index 00000000..80abe2c1 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/bank.rs @@ -0,0 +1,1378 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `cosmos/bank/v1beta1/bank.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +/// Params defines the parameters for the bank module. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Params) +pub struct Params { + // message fields + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Params.send_enabled) + pub send_enabled: ::std::vec::Vec, + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Params.default_send_enabled) + pub default_send_enabled: bool, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Params.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Params { + fn default() -> &'a Params { + ::default_instance() + } +} + +impl Params { + pub fn new() -> Params { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "send_enabled", + |m: &Params| { &m.send_enabled }, + |m: &mut Params| { &mut m.send_enabled }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "default_send_enabled", + |m: &Params| { &m.default_send_enabled }, + |m: &mut Params| { &mut m.default_send_enabled }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Params", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Params { + const NAME: &'static str = "Params"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.send_enabled.push(is.read_message()?); + }, + 16 => { + self.default_send_enabled = is.read_bool()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + for value in &self.send_enabled { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if self.default_send_enabled != false { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + for v in &self.send_enabled { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + if self.default_send_enabled != false { + os.write_bool(2, self.default_send_enabled)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Params { + Params::new() + } + + fn clear(&mut self) { + self.send_enabled.clear(); + self.default_send_enabled = false; + self.special_fields.clear(); + } + + fn default_instance() -> &'static Params { + static instance: Params = Params { + send_enabled: ::std::vec::Vec::new(), + default_send_enabled: false, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Params { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Params").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Params { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Params { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// SendEnabled maps coin denom to a send_enabled status (whether a denom is +/// sendable). +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.SendEnabled) +pub struct SendEnabled { + // message fields + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.SendEnabled.denom) + pub denom: ::std::string::String, + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.SendEnabled.enabled) + pub enabled: bool, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.SendEnabled.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a SendEnabled { + fn default() -> &'a SendEnabled { + ::default_instance() + } +} + +impl SendEnabled { + pub fn new() -> SendEnabled { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "denom", + |m: &SendEnabled| { &m.denom }, + |m: &mut SendEnabled| { &mut m.denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "enabled", + |m: &SendEnabled| { &m.enabled }, + |m: &mut SendEnabled| { &mut m.enabled }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "SendEnabled", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for SendEnabled { + const NAME: &'static str = "SendEnabled"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.denom = is.read_string()?; + }, + 16 => { + self.enabled = is.read_bool()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.denom.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.denom); + } + if self.enabled != false { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.denom.is_empty() { + os.write_string(1, &self.denom)?; + } + if self.enabled != false { + os.write_bool(2, self.enabled)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> SendEnabled { + SendEnabled::new() + } + + fn clear(&mut self) { + self.denom.clear(); + self.enabled = false; + self.special_fields.clear(); + } + + fn default_instance() -> &'static SendEnabled { + static instance: SendEnabled = SendEnabled { + denom: ::std::string::String::new(), + enabled: false, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for SendEnabled { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("SendEnabled").unwrap()).clone() + } +} + +impl ::std::fmt::Display for SendEnabled { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SendEnabled { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Input models transaction input. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Input) +pub struct Input { + // message fields + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Input.address) + pub address: ::std::string::String, + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Input.coins) + pub coins: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Input.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Input { + fn default() -> &'a Input { + ::default_instance() + } +} + +impl Input { + pub fn new() -> Input { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "address", + |m: &Input| { &m.address }, + |m: &mut Input| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "coins", + |m: &Input| { &m.coins }, + |m: &mut Input| { &mut m.coins }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Input", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Input { + const NAME: &'static str = "Input"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.address = is.read_string()?; + }, + 18 => { + self.coins.push(is.read_message()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.address.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.address); + } + for value in &self.coins { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.address.is_empty() { + os.write_string(1, &self.address)?; + } + for v in &self.coins { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Input { + Input::new() + } + + fn clear(&mut self) { + self.address.clear(); + self.coins.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Input { + static instance: Input = Input { + address: ::std::string::String::new(), + coins: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Input { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Input").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Input { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Input { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Output models transaction outputs. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Output) +pub struct Output { + // message fields + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Output.address) + pub address: ::std::string::String, + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Output.coins) + pub coins: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Output.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Output { + fn default() -> &'a Output { + ::default_instance() + } +} + +impl Output { + pub fn new() -> Output { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "address", + |m: &Output| { &m.address }, + |m: &mut Output| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "coins", + |m: &Output| { &m.coins }, + |m: &mut Output| { &mut m.coins }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Output", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Output { + const NAME: &'static str = "Output"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.address = is.read_string()?; + }, + 18 => { + self.coins.push(is.read_message()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.address.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.address); + } + for value in &self.coins { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.address.is_empty() { + os.write_string(1, &self.address)?; + } + for v in &self.coins { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Output { + Output::new() + } + + fn clear(&mut self) { + self.address.clear(); + self.coins.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Output { + static instance: Output = Output { + address: ::std::string::String::new(), + coins: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Output { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Output").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Output { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Output { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Supply represents a struct that passively keeps track of the total supply +/// amounts in the network. +/// This message is deprecated now that supply is indexed by denom. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Supply) +pub struct Supply { + // message fields + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Supply.total) + pub total: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Supply.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Supply { + fn default() -> &'a Supply { + ::default_instance() + } +} + +impl Supply { + pub fn new() -> Supply { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "total", + |m: &Supply| { &m.total }, + |m: &mut Supply| { &mut m.total }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Supply", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Supply { + const NAME: &'static str = "Supply"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.total.push(is.read_message()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + for value in &self.total { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + for v in &self.total { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Supply { + Supply::new() + } + + fn clear(&mut self) { + self.total.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Supply { + static instance: Supply = Supply { + total: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Supply { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Supply").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Supply { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Supply { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// DenomUnit represents a struct that describes a given +/// denomination unit of the basic token. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.DenomUnit) +pub struct DenomUnit { + // message fields + /// denom represents the string name of the given denom unit (e.g uatom). + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.denom) + pub denom: ::std::string::String, + /// exponent represents power of 10 exponent that one must + /// raise the base_denom to in order to equal the given DenomUnit's denom + /// 1 denom = 10^exponent base_denom + /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + /// exponent = 6, thus: 1 atom = 10^6 uatom). + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.exponent) + pub exponent: u32, + /// aliases is a list of string aliases for the given denom + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.aliases) + pub aliases: ::std::vec::Vec<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.DenomUnit.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DenomUnit { + fn default() -> &'a DenomUnit { + ::default_instance() + } +} + +impl DenomUnit { + pub fn new() -> DenomUnit { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "denom", + |m: &DenomUnit| { &m.denom }, + |m: &mut DenomUnit| { &mut m.denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "exponent", + |m: &DenomUnit| { &m.exponent }, + |m: &mut DenomUnit| { &mut m.exponent }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "aliases", + |m: &DenomUnit| { &m.aliases }, + |m: &mut DenomUnit| { &mut m.aliases }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DenomUnit", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DenomUnit { + const NAME: &'static str = "DenomUnit"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.denom = is.read_string()?; + }, + 16 => { + self.exponent = is.read_uint32()?; + }, + 26 => { + self.aliases.push(is.read_string()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.denom.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.denom); + } + if self.exponent != 0 { + my_size += ::protobuf::rt::uint32_size(2, self.exponent); + } + for value in &self.aliases { + my_size += ::protobuf::rt::string_size(3, &value); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.denom.is_empty() { + os.write_string(1, &self.denom)?; + } + if self.exponent != 0 { + os.write_uint32(2, self.exponent)?; + } + for v in &self.aliases { + os.write_string(3, &v)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> DenomUnit { + DenomUnit::new() + } + + fn clear(&mut self) { + self.denom.clear(); + self.exponent = 0; + self.aliases.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static DenomUnit { + static instance: DenomUnit = DenomUnit { + denom: ::std::string::String::new(), + exponent: 0, + aliases: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DenomUnit { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("DenomUnit").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DenomUnit { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DenomUnit { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Metadata represents a struct that describes +/// a basic token. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Metadata) +pub struct Metadata { + // message fields + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.description) + pub description: ::std::string::String, + /// denom_units represents the list of DenomUnit's for a given coin + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.denom_units) + pub denom_units: ::std::vec::Vec, + /// base represents the base denom (should be the DenomUnit with exponent = 0). + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.base) + pub base: ::std::string::String, + /// display indicates the suggested denom that should be + /// displayed in clients. + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.display) + pub display: ::std::string::String, + /// name defines the name of the token (eg: Cosmos Atom) + /// + /// Since: cosmos-sdk 0.43 + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.name) + pub name: ::std::string::String, + /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + /// be the same as the display. + /// + /// Since: cosmos-sdk 0.43 + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.symbol) + pub symbol: ::std::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.uri) + pub uri: ::std::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 + // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.uri_hash) + pub uri_hash: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Metadata.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Metadata { + fn default() -> &'a Metadata { + ::default_instance() + } +} + +impl Metadata { + pub fn new() -> Metadata { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "description", + |m: &Metadata| { &m.description }, + |m: &mut Metadata| { &mut m.description }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "denom_units", + |m: &Metadata| { &m.denom_units }, + |m: &mut Metadata| { &mut m.denom_units }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "base", + |m: &Metadata| { &m.base }, + |m: &mut Metadata| { &mut m.base }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "display", + |m: &Metadata| { &m.display }, + |m: &mut Metadata| { &mut m.display }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "name", + |m: &Metadata| { &m.name }, + |m: &mut Metadata| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "symbol", + |m: &Metadata| { &m.symbol }, + |m: &mut Metadata| { &mut m.symbol }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "uri", + |m: &Metadata| { &m.uri }, + |m: &mut Metadata| { &mut m.uri }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "uri_hash", + |m: &Metadata| { &m.uri_hash }, + |m: &mut Metadata| { &mut m.uri_hash }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Metadata", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Metadata { + const NAME: &'static str = "Metadata"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.description = is.read_string()?; + }, + 18 => { + self.denom_units.push(is.read_message()?); + }, + 26 => { + self.base = is.read_string()?; + }, + 34 => { + self.display = is.read_string()?; + }, + 42 => { + self.name = is.read_string()?; + }, + 50 => { + self.symbol = is.read_string()?; + }, + 58 => { + self.uri = is.read_string()?; + }, + 66 => { + self.uri_hash = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.description.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.description); + } + for value in &self.denom_units { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if !self.base.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.base); + } + if !self.display.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.display); + } + if !self.name.is_empty() { + my_size += ::protobuf::rt::string_size(5, &self.name); + } + if !self.symbol.is_empty() { + my_size += ::protobuf::rt::string_size(6, &self.symbol); + } + if !self.uri.is_empty() { + my_size += ::protobuf::rt::string_size(7, &self.uri); + } + if !self.uri_hash.is_empty() { + my_size += ::protobuf::rt::string_size(8, &self.uri_hash); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.description.is_empty() { + os.write_string(1, &self.description)?; + } + for v in &self.denom_units { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }; + if !self.base.is_empty() { + os.write_string(3, &self.base)?; + } + if !self.display.is_empty() { + os.write_string(4, &self.display)?; + } + if !self.name.is_empty() { + os.write_string(5, &self.name)?; + } + if !self.symbol.is_empty() { + os.write_string(6, &self.symbol)?; + } + if !self.uri.is_empty() { + os.write_string(7, &self.uri)?; + } + if !self.uri_hash.is_empty() { + os.write_string(8, &self.uri_hash)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Metadata { + Metadata::new() + } + + fn clear(&mut self) { + self.description.clear(); + self.denom_units.clear(); + self.base.clear(); + self.display.clear(); + self.name.clear(); + self.symbol.clear(); + self.uri.clear(); + self.uri_hash.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Metadata { + static instance: Metadata = Metadata { + description: ::std::string::String::new(), + denom_units: ::std::vec::Vec::new(), + base: ::std::string::String::new(), + display: ::std::string::String::new(), + name: ::std::string::String::new(), + symbol: ::std::string::String::new(), + uri: ::std::string::String::new(), + uri_hash: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Metadata { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Metadata").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Metadata { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Metadata { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1ecosmos/bank/v1beta1/bank.proto\x12\x13cosmos.bank.v1beta1\x1a\x14g\ + ogoproto/gogo.proto\x1a\x19cosmos_proto/cosmos.proto\x1a\x1ecosmos/base/\ + v1beta1/coin.proto\x1a\x17cosmos/msg/v1/msg.proto\x1a\x11amino/amino.pro\ + to\"\xa6\x01\n\x06Params\x12G\n\x0csend_enabled\x18\x01\x20\x03(\x0b2\ + \x20.cosmos.bank.v1beta1.SendEnabledR\x0bsendEnabledB\x02\x18\x01\x120\n\ + \x14default_send_enabled\x18\x02\x20\x01(\x08R\x12defaultSendEnabled:!\ + \x8a\xe7\xb0*\x18cosmos-sdk/x/bank/Params\x98\xa0\x1f\0\"G\n\x0bSendEnab\ + led\x12\x14\n\x05denom\x18\x01\x20\x01(\tR\x05denom\x12\x18\n\x07enabled\ + \x18\x02\x20\x01(\x08R\x07enabled:\x08\xe8\xa0\x1f\x01\x98\xa0\x1f\0\"\ + \xb9\x01\n\x05Input\x122\n\x07address\x18\x01\x20\x01(\tR\x07addressB\ + \x18\xd2\xb4-\x14cosmos.AddressString\x12f\n\x05coins\x18\x02\x20\x03(\ + \x0b2\x19.cosmos.base.v1beta1.CoinR\x05coinsB5\xaa\xdf\x1f(github.com/co\ + smos/cosmos-sdk/types.Coins\xc8\xde\x1f\0\xa8\xe7\xb0*\x01:\x14\x88\xa0\ + \x1f\0\xe8\xa0\x1f\0\x82\xe7\xb0*\x07address\"\xae\x01\n\x06Output\x122\ + \n\x07address\x18\x01\x20\x01(\tR\x07addressB\x18\xd2\xb4-\x14cosmos.Add\ + ressString\x12f\n\x05coins\x18\x02\x20\x03(\x0b2\x19.cosmos.base.v1beta1\ + .CoinR\x05coinsB5\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.Coins\ + \xc8\xde\x1f\0\xa8\xe7\xb0*\x01:\x08\x88\xa0\x1f\0\xe8\xa0\x1f\0\"\x9b\ + \x01\n\x06Supply\x12f\n\x05total\x18\x01\x20\x03(\x0b2\x19.cosmos.base.v\ + 1beta1.CoinR\x05totalB5\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.C\ + oins\xc8\xde\x1f\0\xa8\xe7\xb0*\x01:)\x18\x01\x88\xa0\x1f\0\xe8\xa0\x1f\ + \x01\xca\xb4-\x1bcosmos.bank.v1beta1.SupplyI\"W\n\tDenomUnit\x12\x14\n\ + \x05denom\x18\x01\x20\x01(\tR\x05denom\x12\x1a\n\x08exponent\x18\x02\x20\ + \x01(\rR\x08exponent\x12\x18\n\x07aliases\x18\x03\x20\x03(\tR\x07aliases\ + \"\x8a\x02\n\x08Metadata\x12\x20\n\x0bdescription\x18\x01\x20\x01(\tR\ + \x0bdescription\x12?\n\x0bdenom_units\x18\x02\x20\x03(\x0b2\x1e.cosmos.b\ + ank.v1beta1.DenomUnitR\ndenomUnits\x12\x12\n\x04base\x18\x03\x20\x01(\tR\ + \x04base\x12\x18\n\x07display\x18\x04\x20\x01(\tR\x07display\x12\x12\n\ + \x04name\x18\x05\x20\x01(\tR\x04name\x12\x16\n\x06symbol\x18\x06\x20\x01\ + (\tR\x06symbol\x12\x19\n\x03uri\x18\x07\x20\x01(\tR\x03uriB\x07\xe2\xde\ + \x1f\x03URI\x12&\n\x08uri_hash\x18\x08\x20\x01(\tR\x07uriHashB\x0b\xe2\ + \xde\x1f\x07URIHashB+Z)github.com/cosmos/cosmos-sdk/x/bank/typesJ\xa0\ + \x20\n\x06\x12\x04\0\0{\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\ + \x02\x12\x03\x01\0\x1c\n\t\n\x02\x03\0\x12\x03\x03\0\x1e\n\t\n\x02\x03\ + \x01\x12\x03\x04\0#\n\t\n\x02\x03\x02\x12\x03\x05\0(\n\t\n\x02\x03\x03\ + \x12\x03\x06\0!\n\t\n\x02\x03\x04\x12\x03\x07\0\x1b\n\x08\n\x01\x08\x12\ + \x03\t\0@\n\t\n\x02\x08\x0b\x12\x03\t\0@\n@\n\x02\x04\0\x12\x04\x0c\0\ + \x16\x01\x1a4\x20Params\x20defines\x20the\x20parameters\x20for\x20the\ + \x20bank\x20module.\n\n\n\n\x03\x04\0\x01\x12\x03\x0c\x08\x0e\n\n\n\x03\ + \x04\0\x07\x12\x03\r\x02C\n\x0e\n\x07\x04\0\x07\xf1\x8c\xa6\x05\x12\x03\ + \r\x02C\n\n\n\x03\x04\0\x07\x12\x03\x0e\x02.\n\r\n\x06\x04\0\x07\x83\xf4\ + \x03\x12\x03\x0e\x02.\n\xb8\x02\n\x04\x04\0\x02\0\x12\x03\x14\x02D\x1a\ + \xaa\x02\x20Deprecated:\x20Use\x20of\x20SendEnabled\x20in\x20params\x20i\ + s\x20deprecated.\n\x20For\x20genesis,\x20use\x20the\x20newly\x20added\ + \x20send_enabled\x20field\x20in\x20the\x20genesis\x20object.\n\x20Storag\ + e,\x20lookup,\x20and\x20manipulation\x20of\x20this\x20information\x20is\ + \x20now\x20in\x20the\x20keeper.\n\n\x20As\x20of\x20cosmos-sdk\x200.47,\ + \x20this\x20only\x20exists\x20for\x20backwards\x20compatibility\x20of\ + \x20genesis\x20files.\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x14\x02\n\n\ + \x0c\n\x05\x04\0\x02\0\x06\x12\x03\x14\x0b\x16\n\x0c\n\x05\x04\0\x02\0\ + \x01\x12\x03\x14\x17#\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x14./\n\x0c\n\ + \x05\x04\0\x02\0\x08\x12\x03\x140C\n\r\n\x06\x04\0\x02\0\x08\x03\x12\x03\ + \x141B\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x15\x020\n\x0c\n\x05\x04\0\x02\ + \x01\x05\x12\x03\x15\x02\x06\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x15\ + \x17+\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x15./\nb\n\x02\x04\x01\x12\ + \x04\x1a\0\x1f\x01\x1aV\x20SendEnabled\x20maps\x20coin\x20denom\x20to\ + \x20a\x20send_enabled\x20status\x20(whether\x20a\x20denom\x20is\n\x20sen\ + dable).\n\n\n\n\x03\x04\x01\x01\x12\x03\x1a\x08\x13\n\n\n\x03\x04\x01\ + \x07\x12\x03\x1b\x02-\n\r\n\x06\x04\x01\x07\x8d\xf4\x03\x12\x03\x1b\x02-\ + \n\n\n\x03\x04\x01\x07\x12\x03\x1c\x02.\n\r\n\x06\x04\x01\x07\x83\xf4\ + \x03\x12\x03\x1c\x02.\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x1d\x02*\n\x0c\n\ + \x05\x04\x01\x02\0\x05\x12\x03\x1d\x02\x08\n\x0c\n\x05\x04\x01\x02\0\x01\ + \x12\x03\x1d\t\x0e\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x1d()\n\x0b\n\ + \x04\x04\x01\x02\x01\x12\x03\x1e\x02*\n\x0c\n\x05\x04\x01\x02\x01\x05\ + \x12\x03\x1e\x02\x06\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x1e\t\x10\n\ + \x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x1e()\n-\n\x02\x04\x02\x12\x04\"\ + \0.\x01\x1a!\x20Input\x20models\x20transaction\x20input.\n\n\n\n\x03\x04\ + \x02\x01\x12\x03\"\x08\r\n\n\n\x03\x04\x02\x07\x12\x03#\x02,\n\x0f\n\x08\ + \x04\x02\x07\xf0\x8c\xa6\x05\0\x12\x03#\x02,\n\n\n\x03\x04\x02\x07\x12\ + \x03%\x02-\n\r\n\x06\x04\x02\x07\x8d\xf4\x03\x12\x03%\x02-\n\n\n\x03\x04\ + \x02\x07\x12\x03&\x02-\n\r\n\x06\x04\x02\x07\x81\xf4\x03\x12\x03&\x02-\n\ + \x0b\n\x04\x04\x02\x02\0\x12\x03(\x02_\n\x0c\n\x05\x04\x02\x02\0\x05\x12\ + \x03(\x02\x08\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03(\x0b\x12\n\x0c\n\x05\ + \x04\x02\x02\0\x03\x12\x03(,-\n\x0c\n\x05\x04\x02\x02\0\x08\x12\x03(.^\n\ + \x0f\n\x08\x04\x02\x02\0\x08\xca\xd6\x05\x12\x03(/]\n\x0c\n\x04\x04\x02\ + \x02\x01\x12\x04)\x02-\x04\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03)\x02\ + \n\n\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03)\x0b#\n\x0c\n\x05\x04\x02\x02\ + \x01\x01\x12\x03)$)\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03),-\n\r\n\x05\ + \x04\x02\x02\x01\x08\x12\x04).-\x03\n\x0f\n\x08\x04\x02\x02\x01\x08\xe9\ + \xfb\x03\x12\x03*\x04$\n\x10\n\t\x04\x02\x02\x01\x08\xf5\x8c\xa6\x05\x12\ + \x03+\x04#\n\x0f\n\x08\x04\x02\x02\x01\x08\xf5\xfb\x03\x12\x03,\x04I\n0\ + \n\x02\x04\x03\x12\x041\0;\x01\x1a$\x20Output\x20models\x20transaction\ + \x20outputs.\n\n\n\n\x03\x04\x03\x01\x12\x031\x08\x0e\n\n\n\x03\x04\x03\ + \x07\x12\x032\x02-\n\r\n\x06\x04\x03\x07\x8d\xf4\x03\x12\x032\x02-\n\n\n\ + \x03\x04\x03\x07\x12\x033\x02-\n\r\n\x06\x04\x03\x07\x81\xf4\x03\x12\x03\ + 3\x02-\n\x0b\n\x04\x04\x03\x02\0\x12\x035\x02_\n\x0c\n\x05\x04\x03\x02\0\ + \x05\x12\x035\x02\x08\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x035\x0b\x12\n\ + \x0c\n\x05\x04\x03\x02\0\x03\x12\x035,-\n\x0c\n\x05\x04\x03\x02\0\x08\ + \x12\x035.^\n\x0f\n\x08\x04\x03\x02\0\x08\xca\xd6\x05\x12\x035/]\n\x0c\n\ + \x04\x04\x03\x02\x01\x12\x046\x02:\x04\n\x0c\n\x05\x04\x03\x02\x01\x04\ + \x12\x036\x02\n\n\x0c\n\x05\x04\x03\x02\x01\x06\x12\x036\x0b#\n\x0c\n\ + \x05\x04\x03\x02\x01\x01\x12\x036$)\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\ + \x036,-\n\r\n\x05\x04\x03\x02\x01\x08\x12\x046.:\x03\n\x0f\n\x08\x04\x03\ + \x02\x01\x08\xe9\xfb\x03\x12\x037\x04$\n\x10\n\t\x04\x03\x02\x01\x08\xf5\ + \x8c\xa6\x05\x12\x038\x04#\n\x0f\n\x08\x04\x03\x02\x01\x08\xf5\xfb\x03\ + \x12\x039\x04I\n\xb2\x01\n\x02\x04\x04\x12\x04@\0M\x01\x1a\xa5\x01\x20Su\ + pply\x20represents\x20a\x20struct\x20that\x20passively\x20keeps\x20track\ + \x20of\x20the\x20total\x20supply\n\x20amounts\x20in\x20the\x20network.\n\ + \x20This\x20message\x20is\x20deprecated\x20now\x20that\x20supply\x20is\ + \x20indexed\x20by\x20denom.\n\n\n\n\x03\x04\x04\x01\x12\x03@\x08\x0e\n\n\ + \n\x03\x04\x04\x07\x12\x03A\x02\x1b\n\x0b\n\x04\x04\x04\x07\x03\x12\x03A\ + \x02\x1b\n\n\n\x03\x04\x04\x07\x12\x03C\x02,\n\r\n\x06\x04\x04\x07\x8d\ + \xf4\x03\x12\x03C\x02,\n\n\n\x03\x04\x04\x07\x12\x03D\x02-\n\r\n\x06\x04\ + \x04\x07\x81\xf4\x03\x12\x03D\x02-\n\n\n\x03\x04\x04\x07\x12\x03F\x02M\n\ + \x0e\n\x07\x04\x04\x07\xc9\xd6\x05\0\x12\x03F\x02M\n\x0c\n\x04\x04\x04\ + \x02\0\x12\x04H\x02L\x04\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03H\x02\n\n\ + \x0c\n\x05\x04\x04\x02\0\x06\x12\x03H\x0b#\n\x0c\n\x05\x04\x04\x02\0\x01\ + \x12\x03H$)\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03H,-\n\r\n\x05\x04\x04\ + \x02\0\x08\x12\x04H.L\x03\n\x0f\n\x08\x04\x04\x02\0\x08\xe9\xfb\x03\x12\ + \x03I\x04$\n\x10\n\t\x04\x04\x02\0\x08\xf5\x8c\xa6\x05\x12\x03J\x04#\n\ + \x0f\n\x08\x04\x04\x02\0\x08\xf5\xfb\x03\x12\x03K\x04I\ni\n\x02\x04\x05\ + \x12\x04Q\0\\\x01\x1a]\x20DenomUnit\x20represents\x20a\x20struct\x20that\ + \x20describes\x20a\x20given\n\x20denomination\x20unit\x20of\x20the\x20ba\ + sic\x20token.\n\n\n\n\x03\x04\x05\x01\x12\x03Q\x08\x11\nT\n\x04\x04\x05\ + \x02\0\x12\x03S\x02\x13\x1aG\x20denom\x20represents\x20the\x20string\x20\ + name\x20of\x20the\x20given\x20denom\x20unit\x20(e.g\x20uatom).\n\n\x0c\n\ + \x05\x04\x05\x02\0\x05\x12\x03S\x02\x08\n\x0c\n\x05\x04\x05\x02\0\x01\ + \x12\x03S\t\x0e\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03S\x11\x12\n\xa7\x02\ + \n\x04\x04\x05\x02\x01\x12\x03Y\x02\x16\x1a\x99\x02\x20exponent\x20repre\ + sents\x20power\x20of\x2010\x20exponent\x20that\x20one\x20must\n\x20raise\ + \x20the\x20base_denom\x20to\x20in\x20order\x20to\x20equal\x20the\x20give\ + n\x20DenomUnit's\x20denom\n\x201\x20denom\x20=\x2010^exponent\x20base_de\ + nom\n\x20(e.g.\x20with\x20a\x20base_denom\x20of\x20uatom,\x20one\x20can\ + \x20create\x20a\x20DenomUnit\x20of\x20'atom'\x20with\n\x20exponent\x20=\ + \x206,\x20thus:\x201\x20atom\x20=\x2010^6\x20uatom).\n\n\x0c\n\x05\x04\ + \x05\x02\x01\x05\x12\x03Y\x02\x08\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\ + \x03Y\t\x11\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03Y\x14\x15\nF\n\x04\ + \x04\x05\x02\x02\x12\x03[\x02\x1e\x1a9\x20aliases\x20is\x20a\x20list\x20\ + of\x20string\x20aliases\x20for\x20the\x20given\x20denom\n\n\x0c\n\x05\ + \x04\x05\x02\x02\x04\x12\x03[\x02\n\n\x0c\n\x05\x04\x05\x02\x02\x05\x12\ + \x03[\x0b\x11\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\x03[\x12\x19\n\x0c\n\ + \x05\x04\x05\x02\x02\x03\x12\x03[\x1c\x1d\nI\n\x02\x04\x06\x12\x04`\0{\ + \x01\x1a=\x20Metadata\x20represents\x20a\x20struct\x20that\x20describes\ + \n\x20a\x20basic\x20token.\n\n\n\n\x03\x04\x06\x01\x12\x03`\x08\x10\n\ + \x0b\n\x04\x04\x06\x02\0\x12\x03a\x02\x19\n\x0c\n\x05\x04\x06\x02\0\x05\ + \x12\x03a\x02\x08\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03a\t\x14\n\x0c\n\ + \x05\x04\x06\x02\0\x03\x12\x03a\x17\x18\nN\n\x04\x04\x06\x02\x01\x12\x03\ + c\x02%\x1aA\x20denom_units\x20represents\x20the\x20list\x20of\x20DenomUn\ + it's\x20for\x20a\x20given\x20coin\n\n\x0c\n\x05\x04\x06\x02\x01\x04\x12\ + \x03c\x02\n\n\x0c\n\x05\x04\x06\x02\x01\x06\x12\x03c\x0b\x14\n\x0c\n\x05\ + \x04\x06\x02\x01\x01\x12\x03c\x15\x20\n\x0c\n\x05\x04\x06\x02\x01\x03\ + \x12\x03c#$\nZ\n\x04\x04\x06\x02\x02\x12\x03e\x02\x12\x1aM\x20base\x20re\ + presents\x20the\x20base\x20denom\x20(should\x20be\x20the\x20DenomUnit\ + \x20with\x20exponent\x20=\x200).\n\n\x0c\n\x05\x04\x06\x02\x02\x05\x12\ + \x03e\x02\x08\n\x0c\n\x05\x04\x06\x02\x02\x01\x12\x03e\t\r\n\x0c\n\x05\ + \x04\x06\x02\x02\x03\x12\x03e\x10\x11\nZ\n\x04\x04\x06\x02\x03\x12\x03h\ + \x02\x15\x1aM\x20display\x20indicates\x20the\x20suggested\x20denom\x20th\ + at\x20should\x20be\n\x20displayed\x20in\x20clients.\n\n\x0c\n\x05\x04\ + \x06\x02\x03\x05\x12\x03h\x02\x08\n\x0c\n\x05\x04\x06\x02\x03\x01\x12\ + \x03h\t\x10\n\x0c\n\x05\x04\x06\x02\x03\x03\x12\x03h\x13\x14\n\\\n\x04\ + \x04\x06\x02\x04\x12\x03l\x02\x12\x1aO\x20name\x20defines\x20the\x20name\ + \x20of\x20the\x20token\x20(eg:\x20Cosmos\x20Atom)\n\n\x20Since:\x20cosmo\ + s-sdk\x200.43\n\n\x0c\n\x05\x04\x06\x02\x04\x05\x12\x03l\x02\x08\n\x0c\n\ + \x05\x04\x06\x02\x04\x01\x12\x03l\t\r\n\x0c\n\x05\x04\x06\x02\x04\x03\ + \x12\x03l\x10\x11\n\x90\x01\n\x04\x04\x06\x02\x05\x12\x03q\x02\x14\x1a\ + \x82\x01\x20symbol\x20is\x20the\x20token\x20symbol\x20usually\x20shown\ + \x20on\x20exchanges\x20(eg:\x20ATOM).\x20This\x20can\n\x20be\x20the\x20s\ + ame\x20as\x20the\x20display.\n\n\x20Since:\x20cosmos-sdk\x200.43\n\n\x0c\ + \n\x05\x04\x06\x02\x05\x05\x12\x03q\x02\x08\n\x0c\n\x05\x04\x06\x02\x05\ + \x01\x12\x03q\t\x0f\n\x0c\n\x05\x04\x06\x02\x05\x03\x12\x03q\x12\x13\n{\ + \n\x04\x04\x06\x02\x06\x12\x03u\x022\x1an\x20URI\x20to\x20a\x20document\ + \x20(on\x20or\x20off-chain)\x20that\x20contains\x20additional\x20informa\ + tion.\x20Optional.\n\n\x20Since:\x20cosmos-sdk\x200.46\n\n\x0c\n\x05\x04\ + \x06\x02\x06\x05\x12\x03u\x02\x08\n\x0c\n\x05\x04\x06\x02\x06\x01\x12\ + \x03u\t\x0c\n\x0c\n\x05\x04\x06\x02\x06\x03\x12\x03u\x0f\x10\n\x0c\n\x05\ + \x04\x06\x02\x06\x08\x12\x03u\x111\n\x0f\n\x08\x04\x06\x02\x06\x08\xec\ + \xfb\x03\x12\x03u\x120\n\x9f\x01\n\x04\x04\x06\x02\x07\x12\x03z\x02;\x1a\ + \x91\x01\x20URIHash\x20is\x20a\x20sha256\x20hash\x20of\x20a\x20document\ + \x20pointed\x20by\x20URI.\x20It's\x20used\x20to\x20verify\x20that\n\x20t\ + he\x20document\x20didn't\x20change.\x20Optional.\n\n\x20Since:\x20cosmos\ + -sdk\x200.46\n\n\x0c\n\x05\x04\x06\x02\x07\x05\x12\x03z\x02\x08\n\x0c\n\ + \x05\x04\x06\x02\x07\x01\x12\x03z\t\x11\n\x0c\n\x05\x04\x06\x02\x07\x03\ + \x12\x03z\x14\x15\n\x0c\n\x05\x04\x06\x02\x07\x08\x12\x03z\x16:\n\x0f\n\ + \x08\x04\x06\x02\x07\x08\xec\xfb\x03\x12\x03z\x179b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(5); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::cosmos::file_descriptor().clone()); + deps.push(super::coin::file_descriptor().clone()); + deps.push(super::msg::file_descriptor().clone()); + deps.push(super::amino::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(7); + messages.push(Params::generated_message_descriptor_data()); + messages.push(SendEnabled::generated_message_descriptor_data()); + messages.push(Input::generated_message_descriptor_data()); + messages.push(Output::generated_message_descriptor_data()); + messages.push(Supply::generated_message_descriptor_data()); + messages.push(DenomUnit::generated_message_descriptor_data()); + messages.push(Metadata::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/cosmos.rs b/packages/neutron-sdk/src/proto_types/cosmos.rs new file mode 100644 index 00000000..2cc0fa48 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/cosmos.rs @@ -0,0 +1,585 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `cosmos_proto/cosmos.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos_proto.InterfaceDescriptor) +pub struct InterfaceDescriptor { + // message fields + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + // @@protoc_insertion_point(field:cosmos_proto.InterfaceDescriptor.name) + pub name: ::std::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + // @@protoc_insertion_point(field:cosmos_proto.InterfaceDescriptor.description) + pub description: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:cosmos_proto.InterfaceDescriptor.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a InterfaceDescriptor { + fn default() -> &'a InterfaceDescriptor { + ::default_instance() + } +} + +impl InterfaceDescriptor { + pub fn new() -> InterfaceDescriptor { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "name", + |m: &InterfaceDescriptor| { &m.name }, + |m: &mut InterfaceDescriptor| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "description", + |m: &InterfaceDescriptor| { &m.description }, + |m: &mut InterfaceDescriptor| { &mut m.description }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "InterfaceDescriptor", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for InterfaceDescriptor { + const NAME: &'static str = "InterfaceDescriptor"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.name = is.read_string()?; + }, + 18 => { + self.description = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.name.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.name); + } + if !self.description.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.description); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.name.is_empty() { + os.write_string(1, &self.name)?; + } + if !self.description.is_empty() { + os.write_string(2, &self.description)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> InterfaceDescriptor { + InterfaceDescriptor::new() + } + + fn clear(&mut self) { + self.name.clear(); + self.description.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static InterfaceDescriptor { + static instance: InterfaceDescriptor = InterfaceDescriptor { + name: ::std::string::String::new(), + description: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for InterfaceDescriptor { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("InterfaceDescriptor").unwrap()).clone() + } +} + +impl ::std::fmt::Display for InterfaceDescriptor { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for InterfaceDescriptor { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:cosmos_proto.ScalarDescriptor) +pub struct ScalarDescriptor { + // message fields + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.name) + pub name: ::std::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.description) + pub description: ::std::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.field_type) + pub field_type: ::std::vec::Vec<::protobuf::EnumOrUnknown>, + // special fields + // @@protoc_insertion_point(special_field:cosmos_proto.ScalarDescriptor.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a ScalarDescriptor { + fn default() -> &'a ScalarDescriptor { + ::default_instance() + } +} + +impl ScalarDescriptor { + pub fn new() -> ScalarDescriptor { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "name", + |m: &ScalarDescriptor| { &m.name }, + |m: &mut ScalarDescriptor| { &mut m.name }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "description", + |m: &ScalarDescriptor| { &m.description }, + |m: &mut ScalarDescriptor| { &mut m.description }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "field_type", + |m: &ScalarDescriptor| { &m.field_type }, + |m: &mut ScalarDescriptor| { &mut m.field_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "ScalarDescriptor", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for ScalarDescriptor { + const NAME: &'static str = "ScalarDescriptor"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.name = is.read_string()?; + }, + 18 => { + self.description = is.read_string()?; + }, + 24 => { + self.field_type.push(is.read_enum_or_unknown()?); + }, + 26 => { + ::protobuf::rt::read_repeated_packed_enum_or_unknown_into(is, &mut self.field_type)? + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.name.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.name); + } + if !self.description.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.description); + } + for value in &self.field_type { + my_size += ::protobuf::rt::int32_size(3, value.value()); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.name.is_empty() { + os.write_string(1, &self.name)?; + } + if !self.description.is_empty() { + os.write_string(2, &self.description)?; + } + for v in &self.field_type { + os.write_enum(3, ::protobuf::EnumOrUnknown::value(v))?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> ScalarDescriptor { + ScalarDescriptor::new() + } + + fn clear(&mut self) { + self.name.clear(); + self.description.clear(); + self.field_type.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static ScalarDescriptor { + static instance: ScalarDescriptor = ScalarDescriptor { + name: ::std::string::String::new(), + description: ::std::string::String::new(), + field_type: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for ScalarDescriptor { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("ScalarDescriptor").unwrap()).clone() + } +} + +impl ::std::fmt::Display for ScalarDescriptor { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ScalarDescriptor { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:cosmos_proto.ScalarType) +pub enum ScalarType { + // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_UNSPECIFIED) + SCALAR_TYPE_UNSPECIFIED = 0, + // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_STRING) + SCALAR_TYPE_STRING = 1, + // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_BYTES) + SCALAR_TYPE_BYTES = 2, +} + +impl ::protobuf::Enum for ScalarType { + const NAME: &'static str = "ScalarType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_UNSPECIFIED), + 1 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_STRING), + 2 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_BYTES), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [ScalarType] = &[ + ScalarType::SCALAR_TYPE_UNSPECIFIED, + ScalarType::SCALAR_TYPE_STRING, + ScalarType::SCALAR_TYPE_BYTES, + ]; +} + +impl ::protobuf::EnumFull for ScalarType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().enum_by_package_relative_name("ScalarType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = *self as usize; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for ScalarType { + fn default() -> Self { + ScalarType::SCALAR_TYPE_UNSPECIFIED + } +} + +impl ScalarType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("ScalarType") + } +} + +/// Extension fields +pub mod exts { + + pub const implements_interface: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::MessageOptions, ::std::string::String> = ::protobuf::ext::ExtFieldRepeated::new(93001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const accepts_interface: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(93001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const scalar: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(93002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const declare_interface: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::FileOptions, super::InterfaceDescriptor> = ::protobuf::ext::ExtFieldRepeated::new(793021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_MESSAGE); + + pub const declare_scalar: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::FileOptions, super::ScalarDescriptor> = ::protobuf::ext::ExtFieldRepeated::new(793022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_MESSAGE); +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19cosmos_proto/cosmos.proto\x12\x0ccosmos_proto\x1a\x20google/protob\ + uf/descriptor.proto\"K\n\x13InterfaceDescriptor\x12\x12\n\x04name\x18\ + \x01\x20\x01(\tR\x04name\x12\x20\n\x0bdescription\x18\x02\x20\x01(\tR\ + \x0bdescription\"\x81\x01\n\x10ScalarDescriptor\x12\x12\n\x04name\x18\ + \x01\x20\x01(\tR\x04name\x12\x20\n\x0bdescription\x18\x02\x20\x01(\tR\ + \x0bdescription\x127\n\nfield_type\x18\x03\x20\x03(\x0e2\x18.cosmos_prot\ + o.ScalarTypeR\tfieldType*X\n\nScalarType\x12\x1b\n\x17SCALAR_TYPE_UNSPEC\ + IFIED\x10\0\x12\x16\n\x12SCALAR_TYPE_STRING\x10\x01\x12\x15\n\x11SCALAR_\ + TYPE_BYTES\x10\x02:T\n\x14implements_interface\x18\xc9\xd6\x05\x20\x03(\ + \t\x12\x1f.google.protobuf.MessageOptionsR\x13implementsInterface:L\n\ + \x11accepts_interface\x18\xc9\xd6\x05\x20\x01(\t\x12\x1d.google.protobuf\ + .FieldOptionsR\x10acceptsInterface:7\n\x06scalar\x18\xca\xd6\x05\x20\x01\ + (\t\x12\x1d.google.protobuf.FieldOptionsR\x06scalar:n\n\x11declare_inter\ + face\x18\xbd\xb30\x20\x03(\x0b2!.cosmos_proto.InterfaceDescriptor\x12\ + \x1c.google.protobuf.FileOptionsR\x10declareInterface:e\n\x0edeclare_sca\ + lar\x18\xbe\xb30\x20\x03(\x0b2\x1e.cosmos_proto.ScalarDescriptor\x12\x1c\ + .google.protobuf.FileOptionsR\rdeclareScalarB-Z+github.com/cosmos/cosmos\ + -proto;cosmos_protoJ\xb0\x1f\n\x06\x12\x04\0\0`\x01\n\x08\n\x01\x0c\x12\ + \x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x15\n\t\n\x02\x03\0\x12\x03\ + \x03\0*\n\x08\n\x01\x08\x12\x03\x05\0B\n\t\n\x02\x08\x0b\x12\x03\x05\0B\ + \n\t\n\x01\x07\x12\x04\x07\0\x0f\x01\n\xb6\x02\n\x02\x07\0\x12\x03\x0e\ + \x041\x1a\xaa\x02\x20implements_interface\x20is\x20used\x20to\x20indicat\ + e\x20the\x20type\x20name\x20of\x20the\x20interface\n\x20that\x20a\x20mes\ + sage\x20implements\x20so\x20that\x20it\x20can\x20be\x20used\x20in\x20goo\ + gle.protobuf.Any\n\x20fields\x20that\x20accept\x20that\x20interface.\x20\ + A\x20message\x20can\x20implement\x20multiple\n\x20interfaces.\x20Interfa\ + ces\x20should\x20be\x20declared\x20using\x20a\x20declare_interface\n\x20\ + file\x20option.\n\n\n\n\x03\x07\0\x02\x12\x03\x07\x07%\n\n\n\x03\x07\0\ + \x04\x12\x03\x0e\x04\x0c\n\n\n\x03\x07\0\x05\x12\x03\x0e\r\x13\n\n\n\x03\ + \x07\0\x01\x12\x03\x0e\x14(\n\n\n\x03\x07\0\x03\x12\x03\x0e+0\n\t\n\x01\ + \x07\x12\x04\x11\0\x1d\x01\n\xd4\x01\n\x02\x07\x01\x12\x03\x16\x04%\x1a\ + \xc8\x01\x20accepts_interface\x20is\x20used\x20to\x20annotate\x20that\ + \x20a\x20google.protobuf.Any\n\x20field\x20accepts\x20messages\x20that\ + \x20implement\x20the\x20specified\x20interface.\n\x20Interfaces\x20shoul\ + d\x20be\x20declared\x20using\x20a\x20declare_interface\x20file\x20option\ + .\n\n\n\n\x03\x07\x01\x02\x12\x03\x11\x07#\n\n\n\x03\x07\x01\x05\x12\x03\ + \x16\x04\n\n\n\n\x03\x07\x01\x01\x12\x03\x16\x0b\x1c\n\n\n\x03\x07\x01\ + \x03\x12\x03\x16\x1f$\n\x96\x02\n\x02\x07\x02\x12\x03\x1c\x04\x1a\x1a\ + \x8a\x02\x20scalar\x20is\x20used\x20to\x20indicate\x20that\x20this\x20fi\ + eld\x20follows\x20the\x20formatting\x20defined\n\x20by\x20the\x20named\ + \x20scalar\x20which\x20should\x20be\x20declared\x20with\x20declare_scala\ + r.\x20Code\n\x20generators\x20may\x20choose\x20to\x20use\x20this\x20info\ + rmation\x20to\x20map\x20this\x20field\x20to\x20a\n\x20language-specific\ + \x20type\x20representing\x20the\x20scalar.\n\n\n\n\x03\x07\x02\x02\x12\ + \x03\x11\x07#\n\n\n\x03\x07\x02\x05\x12\x03\x1c\x04\n\n\n\n\x03\x07\x02\ + \x01\x12\x03\x1c\x0b\x11\n\n\n\x03\x07\x02\x03\x12\x03\x1c\x14\x19\n\t\n\ + \x01\x07\x12\x04\x1f\00\x01\n\x91\x03\n\x02\x07\x03\x12\x03'\x04<\x1a\ + \x85\x03\x20declare_interface\x20declares\x20an\x20interface\x20type\x20\ + to\x20be\x20used\x20with\n\x20accepts_interface\x20and\x20implements_int\ + erface.\x20Interface\x20names\x20are\n\x20expected\x20to\x20follow\x20th\ + e\x20following\x20convention\x20such\x20that\x20their\x20declaration\n\ + \x20can\x20be\x20discovered\x20by\x20tools:\x20for\x20a\x20given\x20inte\ + rface\x20type\x20a.b.C,\x20it\x20is\n\x20expected\x20that\x20the\x20decl\ + aration\x20will\x20be\x20found\x20in\x20a\x20protobuf\x20file\x20named\n\ + \x20a/b/interfaces.proto\x20in\x20the\x20file\x20descriptor\x20set.\n\n\ + \n\n\x03\x07\x03\x02\x12\x03\x1f\x07\"\n\n\n\x03\x07\x03\x04\x12\x03'\ + \x04\x0c\n\n\n\x03\x07\x03\x06\x12\x03'\r\x20\n\n\n\x03\x07\x03\x01\x12\ + \x03'!2\n\n\n\x03\x07\x03\x03\x12\x03'5;\n\xee\x02\n\x02\x07\x04\x12\x03\ + /\x046\x1a\xe2\x02\x20declare_scalar\x20declares\x20a\x20scalar\x20type\ + \x20to\x20be\x20used\x20with\n\x20the\x20scalar\x20field\x20option.\x20S\ + calar\x20names\x20are\n\x20expected\x20to\x20follow\x20the\x20following\ + \x20convention\x20such\x20that\x20their\x20declaration\n\x20can\x20be\ + \x20discovered\x20by\x20tools:\x20for\x20a\x20given\x20scalar\x20type\ + \x20a.b.C,\x20it\x20is\n\x20expected\x20that\x20the\x20declaration\x20wi\ + ll\x20be\x20found\x20in\x20a\x20protobuf\x20file\x20named\n\x20a/b/scala\ + rs.proto\x20in\x20the\x20file\x20descriptor\x20set.\n\n\n\n\x03\x07\x04\ + \x02\x12\x03\x1f\x07\"\n\n\n\x03\x07\x04\x04\x12\x03/\x04\x0c\n\n\n\x03\ + \x07\x04\x06\x12\x03/\r\x1d\n\n\n\x03\x07\x04\x01\x12\x03/\x1e,\n\n\n\ + \x03\x07\x04\x03\x12\x03//5\n\x9d\x01\n\x02\x04\0\x12\x044\0?\x01\x1a\ + \x90\x01\x20InterfaceDescriptor\x20describes\x20an\x20interface\x20type\ + \x20to\x20be\x20used\x20with\n\x20accepts_interface\x20and\x20implements\ + _interface\x20and\x20declared\x20by\x20declare_interface.\n\n\n\n\x03\ + \x04\0\x01\x12\x034\x08\x1b\n\x83\x02\n\x04\x04\0\x02\0\x12\x03:\x04\x14\ + \x1a\xf5\x01\x20name\x20is\x20the\x20name\x20of\x20the\x20interface.\x20\ + It\x20should\x20be\x20a\x20short-name\x20(without\n\x20a\x20period)\x20s\ + uch\x20that\x20the\x20fully\x20qualified\x20name\x20of\x20the\x20interfa\ + ce\x20will\x20be\n\x20package.name,\x20ex.\x20for\x20the\x20package\x20a\ + .b\x20and\x20interface\x20named\x20C,\x20the\n\x20fully-qualified\x20nam\ + e\x20will\x20be\x20a.b.C.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03:\x04\n\n\ + \x0c\n\x05\x04\0\x02\0\x01\x12\x03:\x0b\x0f\n\x0c\n\x05\x04\0\x02\0\x03\ + \x12\x03:\x12\x13\n]\n\x04\x04\0\x02\x01\x12\x03>\x04\x1b\x1aP\x20descri\ + ption\x20is\x20a\x20human-readable\x20description\x20of\x20the\x20interf\ + ace\x20and\x20its\n\x20purpose.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03>\ + \x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03>\x0b\x16\n\x0c\n\x05\x04\0\ + \x02\x01\x03\x12\x03>\x19\x1a\n\xb2\x03\n\x02\x04\x01\x12\x04H\0Z\x01\ + \x1a\xa5\x03\x20ScalarDescriptor\x20describes\x20an\x20scalar\x20type\ + \x20to\x20be\x20used\x20with\n\x20the\x20scalar\x20field\x20option\x20an\ + d\x20declared\x20by\x20declare_scalar.\n\x20Scalars\x20extend\x20simple\ + \x20protobuf\x20built-in\x20types\x20with\x20additional\n\x20syntax\x20a\ + nd\x20semantics,\x20for\x20instance\x20to\x20represent\x20big\x20integer\ + s.\n\x20Scalars\x20should\x20ideally\x20define\x20an\x20encoding\x20such\ + \x20that\x20there\x20is\x20only\x20one\n\x20valid\x20syntactical\x20repr\ + esentation\x20for\x20a\x20given\x20semantic\x20meaning,\n\x20i.e.\x20the\ + \x20encoding\x20should\x20be\x20deterministic.\n\n\n\n\x03\x04\x01\x01\ + \x12\x03H\x08\x18\n\xfa\x01\n\x04\x04\x01\x02\0\x12\x03N\x04\x14\x1a\xec\ + \x01\x20name\x20is\x20the\x20name\x20of\x20the\x20scalar.\x20It\x20shoul\ + d\x20be\x20a\x20short-name\x20(without\n\x20a\x20period)\x20such\x20that\ + \x20the\x20fully\x20qualified\x20name\x20of\x20the\x20scalar\x20will\x20\ + be\n\x20package.name,\x20ex.\x20for\x20the\x20package\x20a.b\x20and\x20s\ + calar\x20named\x20C,\x20the\n\x20fully-qualified\x20name\x20will\x20be\ + \x20a.b.C.\n\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03N\x04\n\n\x0c\n\x05\ + \x04\x01\x02\0\x01\x12\x03N\x0b\x0f\n\x0c\n\x05\x04\x01\x02\0\x03\x12\ + \x03N\x12\x13\n\xc8\x01\n\x04\x04\x01\x02\x01\x12\x03S\x04\x1b\x1a\xba\ + \x01\x20description\x20is\x20a\x20human-readable\x20description\x20of\ + \x20the\x20scalar\x20and\x20its\n\x20encoding\x20format.\x20For\x20insta\ + nce\x20a\x20big\x20integer\x20or\x20decimal\x20scalar\x20should\n\x20spe\ + cify\x20precisely\x20the\x20expected\x20encoding\x20format.\n\n\x0c\n\ + \x05\x04\x01\x02\x01\x05\x12\x03S\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\ + \x12\x03S\x0b\x16\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03S\x19\x1a\n\x81\ + \x02\n\x04\x04\x01\x02\x02\x12\x03Y\x04'\x1a\xf3\x01\x20field_type\x20is\ + \x20the\x20type\x20of\x20field\x20with\x20which\x20this\x20scalar\x20can\ + \x20be\x20used.\n\x20Scalars\x20can\x20be\x20used\x20with\x20one\x20and\ + \x20only\x20one\x20type\x20of\x20field\x20so\x20that\n\x20encoding\x20st\ + andards\x20and\x20simple\x20and\x20clear.\x20Currently\x20only\x20string\ + \x20and\n\x20bytes\x20fields\x20are\x20supported\x20for\x20scalars.\n\n\ + \x0c\n\x05\x04\x01\x02\x02\x04\x12\x03Y\x04\x0c\n\x0c\n\x05\x04\x01\x02\ + \x02\x06\x12\x03Y\r\x17\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03Y\x18\"\n\ + \x0c\n\x05\x04\x01\x02\x02\x03\x12\x03Y%&\n\n\n\x02\x05\0\x12\x04\\\0`\ + \x01\n\n\n\x03\x05\0\x01\x12\x03\\\x05\x0f\n\x0b\n\x04\x05\0\x02\0\x12\ + \x03]\x04\x20\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03]\x04\x1b\n\x0c\n\x05\ + \x05\0\x02\0\x02\x12\x03]\x1e\x1f\n\x0b\n\x04\x05\0\x02\x01\x12\x03^\x04\ + \x1b\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03^\x04\x16\n\x0c\n\x05\x05\0\ + \x02\x01\x02\x12\x03^\x19\x1a\n\x0b\n\x04\x05\0\x02\x02\x12\x03_\x04\x1a\ + \n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03_\x04\x15\n\x0c\n\x05\x05\0\x02\ + \x02\x02\x12\x03_\x18\x19b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(1); + deps.push(::protobuf::descriptor::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(2); + messages.push(InterfaceDescriptor::generated_message_descriptor_data()); + messages.push(ScalarDescriptor::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(ScalarType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/deposit_record.rs b/packages/neutron-sdk/src/proto_types/deposit_record.rs new file mode 100644 index 00000000..273b0c3e --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/deposit_record.rs @@ -0,0 +1,308 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/deposit_record.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.DepositRecord) +pub struct DepositRecord { + // message fields + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.pair_id) + pub pair_id: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.shares_owned) + pub shares_owned: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.center_tick_index) + pub center_tick_index: i64, + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.lower_tick_index) + pub lower_tick_index: i64, + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.upper_tick_index) + pub upper_tick_index: i64, + // @@protoc_insertion_point(field:neutron.dex.DepositRecord.fee) + pub fee: u64, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.DepositRecord.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DepositRecord { + fn default() -> &'a DepositRecord { + ::default_instance() + } +} + +impl DepositRecord { + pub fn new() -> DepositRecord { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pair_id::PairID>( + "pair_id", + |m: &DepositRecord| { &m.pair_id }, + |m: &mut DepositRecord| { &mut m.pair_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "shares_owned", + |m: &DepositRecord| { &m.shares_owned }, + |m: &mut DepositRecord| { &mut m.shares_owned }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "center_tick_index", + |m: &DepositRecord| { &m.center_tick_index }, + |m: &mut DepositRecord| { &mut m.center_tick_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "lower_tick_index", + |m: &DepositRecord| { &m.lower_tick_index }, + |m: &mut DepositRecord| { &mut m.lower_tick_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "upper_tick_index", + |m: &DepositRecord| { &m.upper_tick_index }, + |m: &mut DepositRecord| { &mut m.upper_tick_index }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "fee", + |m: &DepositRecord| { &m.fee }, + |m: &mut DepositRecord| { &mut m.fee }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DepositRecord", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DepositRecord { + const NAME: &'static str = "DepositRecord"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.pair_id)?; + }, + 18 => { + self.shares_owned = is.read_string()?; + }, + 24 => { + self.center_tick_index = is.read_int64()?; + }, + 32 => { + self.lower_tick_index = is.read_int64()?; + }, + 40 => { + self.upper_tick_index = is.read_int64()?; + }, + 48 => { + self.fee = is.read_uint64()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.pair_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.shares_owned.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.shares_owned); + } + if self.center_tick_index != 0 { + my_size += ::protobuf::rt::int64_size(3, self.center_tick_index); + } + if self.lower_tick_index != 0 { + my_size += ::protobuf::rt::int64_size(4, self.lower_tick_index); + } + if self.upper_tick_index != 0 { + my_size += ::protobuf::rt::int64_size(5, self.upper_tick_index); + } + if self.fee != 0 { + my_size += ::protobuf::rt::uint64_size(6, self.fee); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.pair_id.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if !self.shares_owned.is_empty() { + os.write_string(2, &self.shares_owned)?; + } + if self.center_tick_index != 0 { + os.write_int64(3, self.center_tick_index)?; + } + if self.lower_tick_index != 0 { + os.write_int64(4, self.lower_tick_index)?; + } + if self.upper_tick_index != 0 { + os.write_int64(5, self.upper_tick_index)?; + } + if self.fee != 0 { + os.write_uint64(6, self.fee)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> DepositRecord { + DepositRecord::new() + } + + fn clear(&mut self) { + self.pair_id.clear(); + self.shares_owned.clear(); + self.center_tick_index = 0; + self.lower_tick_index = 0; + self.upper_tick_index = 0; + self.fee = 0; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DepositRecord { + static instance: DepositRecord = DepositRecord { + pair_id: ::protobuf::MessageField::none(), + shares_owned: ::std::string::String::new(), + center_tick_index: 0, + lower_tick_index: 0, + upper_tick_index: 0, + fee: 0, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DepositRecord { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("DepositRecord").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DepositRecord { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DepositRecord { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x20neutron/dex/deposit_record.proto\x12\x0bneutron.dex\x1a\x14gogopro\ + to/gogo.proto\x1a\x19neutron/dex/pair_id.proto\"\xc9\x02\n\rDepositRecor\ + d\x12,\n\x07pair_id\x18\x01\x20\x01(\x0b2\x13.neutron.dex.PairIDR\x06pai\ + rId\x12x\n\x0cshares_owned\x18\x02\x20\x01(\tR\x0bsharesOwnedBU\xf2\xde\ + \x1f\x13yaml:\"shares_owned\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/t\ + ypes.Int\xc8\xde\x1f\0\xea\xde\x1f\x0cshares_owned\x12*\n\x11center_tick\ + _index\x18\x03\x20\x01(\x03R\x0fcenterTickIndex\x12(\n\x10lower_tick_ind\ + ex\x18\x04\x20\x01(\x03R\x0elowerTickIndex\x12(\n\x10upper_tick_index\ + \x18\x05\x20\x01(\x03R\x0eupperTickIndex\x12\x10\n\x03fee\x18\x06\x20\ + \x01(\x04R\x03feeB,Z*github.com/neutron-org/neutron/x/dex/typesJ\xfd\x03\ + \n\x06\x12\x04\0\0\x13\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\ + \x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\ + \x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\ + \x03\x05\0#\n\n\n\x02\x04\0\x12\x04\x07\0\x13\x01\n\n\n\x03\x04\0\x01\ + \x12\x03\x07\x08\x15\n\x0b\n\x04\x04\0\x02\0\x12\x03\x08\x02\x15\n\x0c\n\ + \x05\x04\0\x02\0\x06\x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\ + \x03\x08\t\x10\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x13\x14\n\x0c\n\ + \x04\x04\0\x02\x01\x12\x04\t\x02\x0e\x1c\n\x0c\n\x05\x04\0\x02\x01\x05\ + \x12\x03\t\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\t\t\x15\n\x0c\n\ + \x05\x04\0\x02\x01\x03\x12\x03\t\x18\x19\n\r\n\x05\x04\0\x02\x01\x08\x12\ + \x04\t\x1a\x0e\x1b\n\x0f\n\x08\x04\0\x02\x01\x08\xee\xfb\x03\x12\x03\n\ + \x1aJ\n\x0f\n\x08\x04\0\x02\x01\x08\xeb\xfb\x03\x12\x03\x0b\x1a[\n\x0f\n\ + \x08\x04\0\x02\x01\x08\xe9\xfb\x03\x12\x03\x0c\x1a8\n\x0f\n\x08\x04\0\ + \x02\x01\x08\xed\xfb\x03\x12\x03\r\x1a>\n\x0b\n\x04\x04\0\x02\x02\x12\ + \x03\x0f\x02\x1e\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x0f\x02\x07\n\x0c\ + \n\x05\x04\0\x02\x02\x01\x12\x03\x0f\x08\x19\n\x0c\n\x05\x04\0\x02\x02\ + \x03\x12\x03\x0f\x1c\x1d\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x10\x02\x1d\n\ + \x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x10\x02\x07\n\x0c\n\x05\x04\0\x02\ + \x03\x01\x12\x03\x10\x08\x18\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x10\ + \x1b\x1c\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x11\x02\x1d\n\x0c\n\x05\x04\0\ + \x02\x04\x05\x12\x03\x11\x02\x07\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\ + \x11\x08\x18\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x11\x1b\x1c\n\x0b\n\ + \x04\x04\0\x02\x05\x12\x03\x12\x02\x11\n\x0c\n\x05\x04\0\x02\x05\x05\x12\ + \x03\x12\x02\x08\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x12\t\x0c\n\x0c\n\ + \x05\x04\0\x02\x05\x03\x12\x03\x12\x0f\x10b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(2); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::pair_id::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(DepositRecord::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/gogo.rs b/packages/neutron-sdk/src/proto_types/gogo.rs new file mode 100644 index 00000000..72d8ba4a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/gogo.rs @@ -0,0 +1,600 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `gogoproto/gogo.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +/// Extension fields +pub mod exts { + + pub const goproto_enum_prefix: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_enum_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const enum_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const enum_customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(62023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const enumdecl: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const enumvalue_customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(66001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const goproto_getters_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_enum_prefix_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const verbose_equal_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const face_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const gostring_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const populate_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const onlyone_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const equal_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const description_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63014, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const testgen_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63015, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const benchgen_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63016, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63017, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unmarshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63018, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const stable_marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63019, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const sizer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63020, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_enum_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const enum_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unsafe_marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unsafe_unmarshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_extensions_map_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63025, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_unrecognized_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63026, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const gogoproto_import: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63027, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const protosizer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63028, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const compare_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63029, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const typedecl_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63030, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const enumdecl_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63031, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_registration: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63032, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const messagename_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63033, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_sizecache_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63034, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_unkeyed_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63035, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_getters: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const verbose_equal: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const face: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const gostring: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const populate: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(67008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const onlyone: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const equal: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const description: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64014, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const testgen: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64015, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const benchgen: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64016, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64017, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unmarshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64018, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const stable_marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64019, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const sizer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64020, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unsafe_marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const unsafe_unmarshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_extensions_map: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64025, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_unrecognized: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64026, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const protosizer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64028, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const compare: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64029, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const typedecl: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64030, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const messagename: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64033, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_sizecache: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64034, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const goproto_unkeyed: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64035, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const nullable: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const embed: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const customtype: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const jsontag: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const moretags: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const casttype: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const castkey: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const castvalue: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); + + pub const stdtime: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65010, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const stdduration: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65011, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const wktpointer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65012, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); + + pub const castrepeated: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14gogoproto/gogo.proto\x12\tgogoproto\x1a\x20google/protobuf/descrip\ + tor.proto:N\n\x13goproto_enum_prefix\x18\xb1\xe4\x03\x20\x01(\x08\x12\ + \x1c.google.protobuf.EnumOptionsR\x11goprotoEnumPrefix:R\n\x15goproto_en\ + um_stringer\x18\xc5\xe4\x03\x20\x01(\x08\x12\x1c.google.protobuf.EnumOpt\ + ionsR\x13goprotoEnumStringer:C\n\renum_stringer\x18\xc6\xe4\x03\x20\x01(\ + \x08\x12\x1c.google.protobuf.EnumOptionsR\x0cenumStringer:G\n\x0fenum_cu\ + stomname\x18\xc7\xe4\x03\x20\x01(\t\x12\x1c.google.protobuf.EnumOptionsR\ + \x0eenumCustomname::\n\x08enumdecl\x18\xc8\xe4\x03\x20\x01(\x08\x12\x1c.\ + google.protobuf.EnumOptionsR\x08enumdecl:V\n\x14enumvalue_customname\x18\ + \xd1\x83\x04\x20\x01(\t\x12!.google.protobuf.EnumValueOptionsR\x13enumva\ + lueCustomname:N\n\x13goproto_getters_all\x18\x99\xec\x03\x20\x01(\x08\ + \x12\x1c.google.protobuf.FileOptionsR\x11goprotoGettersAll:U\n\x17goprot\ + o_enum_prefix_all\x18\x9a\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.F\ + ileOptionsR\x14goprotoEnumPrefixAll:P\n\x14goproto_stringer_all\x18\x9b\ + \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x12goprotoStr\ + ingerAll:J\n\x11verbose_equal_all\x18\x9c\xec\x03\x20\x01(\x08\x12\x1c.g\ + oogle.protobuf.FileOptionsR\x0fverboseEqualAll:9\n\x08face_all\x18\x9d\ + \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x07faceAll:A\ + \n\x0cgostring_all\x18\x9e\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.\ + FileOptionsR\x0bgostringAll:A\n\x0cpopulate_all\x18\x9f\xec\x03\x20\x01(\ + \x08\x12\x1c.google.protobuf.FileOptionsR\x0bpopulateAll:A\n\x0cstringer\ + _all\x18\xa0\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ + \x0bstringerAll:?\n\x0bonlyone_all\x18\xa1\xec\x03\x20\x01(\x08\x12\x1c.\ + google.protobuf.FileOptionsR\nonlyoneAll:;\n\tequal_all\x18\xa5\xec\x03\ + \x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x08equalAll:G\n\x0fde\ + scription_all\x18\xa6\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileO\ + ptionsR\x0edescriptionAll:?\n\x0btestgen_all\x18\xa7\xec\x03\x20\x01(\ + \x08\x12\x1c.google.protobuf.FileOptionsR\ntestgenAll:A\n\x0cbenchgen_al\ + l\x18\xa8\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x0bb\ + enchgenAll:C\n\rmarshaler_all\x18\xa9\xec\x03\x20\x01(\x08\x12\x1c.googl\ + e.protobuf.FileOptionsR\x0cmarshalerAll:G\n\x0funmarshaler_all\x18\xaa\ + \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x0eunmarshale\ + rAll:P\n\x14stable_marshaler_all\x18\xab\xec\x03\x20\x01(\x08\x12\x1c.go\ + ogle.protobuf.FileOptionsR\x12stableMarshalerAll:;\n\tsizer_all\x18\xac\ + \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x08sizerAll:Y\ + \n\x19goproto_enum_stringer_all\x18\xad\xec\x03\x20\x01(\x08\x12\x1c.goo\ + gle.protobuf.FileOptionsR\x16goprotoEnumStringerAll:J\n\x11enum_stringer\ + _all\x18\xae\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ + \x0fenumStringerAll:P\n\x14unsafe_marshaler_all\x18\xaf\xec\x03\x20\x01(\ + \x08\x12\x1c.google.protobuf.FileOptionsR\x12unsafeMarshalerAll:T\n\x16u\ + nsafe_unmarshaler_all\x18\xb0\xec\x03\x20\x01(\x08\x12\x1c.google.protob\ + uf.FileOptionsR\x14unsafeUnmarshalerAll:[\n\x1agoproto_extensions_map_al\ + l\x18\xb1\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x17g\ + oprotoExtensionsMapAll:X\n\x18goproto_unrecognized_all\x18\xb2\xec\x03\ + \x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x16goprotoUnrecognize\ + dAll:I\n\x10gogoproto_import\x18\xb3\xec\x03\x20\x01(\x08\x12\x1c.google\ + .protobuf.FileOptionsR\x0fgogoprotoImport:E\n\x0eprotosizer_all\x18\xb4\ + \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\rprotosizerAl\ + l:?\n\x0bcompare_all\x18\xb5\xec\x03\x20\x01(\x08\x12\x1c.google.protobu\ + f.FileOptionsR\ncompareAll:A\n\x0ctypedecl_all\x18\xb6\xec\x03\x20\x01(\ + \x08\x12\x1c.google.protobuf.FileOptionsR\x0btypedeclAll:A\n\x0cenumdecl\ + _all\x18\xb7\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ + \x0benumdeclAll:Q\n\x14goproto_registration\x18\xb8\xec\x03\x20\x01(\x08\ + \x12\x1c.google.protobuf.FileOptionsR\x13goprotoRegistration:G\n\x0fmess\ + agename_all\x18\xb9\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOpt\ + ionsR\x0emessagenameAll:R\n\x15goproto_sizecache_all\x18\xba\xec\x03\x20\ + \x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x13goprotoSizecacheAll:N\ + \n\x13goproto_unkeyed_all\x18\xbb\xec\x03\x20\x01(\x08\x12\x1c.google.pr\ + otobuf.FileOptionsR\x11goprotoUnkeyedAll:J\n\x0fgoproto_getters\x18\x81\ + \xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0egoproto\ + Getters:L\n\x10goproto_stringer\x18\x83\xf4\x03\x20\x01(\x08\x12\x1f.goo\ + gle.protobuf.MessageOptionsR\x0fgoprotoStringer:F\n\rverbose_equal\x18\ + \x84\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0cver\ + boseEqual:5\n\x04face\x18\x85\xf4\x03\x20\x01(\x08\x12\x1f.google.protob\ + uf.MessageOptionsR\x04face:=\n\x08gostring\x18\x86\xf4\x03\x20\x01(\x08\ + \x12\x1f.google.protobuf.MessageOptionsR\x08gostring:=\n\x08populate\x18\ + \x87\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x08pop\ + ulate:=\n\x08stringer\x18\xc0\x8b\x04\x20\x01(\x08\x12\x1f.google.protob\ + uf.MessageOptionsR\x08stringer:;\n\x07onlyone\x18\x89\xf4\x03\x20\x01(\ + \x08\x12\x1f.google.protobuf.MessageOptionsR\x07onlyone:7\n\x05equal\x18\ + \x8d\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x05equ\ + al:C\n\x0bdescription\x18\x8e\xf4\x03\x20\x01(\x08\x12\x1f.google.protob\ + uf.MessageOptionsR\x0bdescription:;\n\x07testgen\x18\x8f\xf4\x03\x20\x01\ + (\x08\x12\x1f.google.protobuf.MessageOptionsR\x07testgen:=\n\x08benchgen\ + \x18\x90\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\ + \x08benchgen:?\n\tmarshaler\x18\x91\xf4\x03\x20\x01(\x08\x12\x1f.google.\ + protobuf.MessageOptionsR\tmarshaler:C\n\x0bunmarshaler\x18\x92\xf4\x03\ + \x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0bunmarshaler:L\n\ + \x10stable_marshaler\x18\x93\xf4\x03\x20\x01(\x08\x12\x1f.google.protobu\ + f.MessageOptionsR\x0fstableMarshaler:7\n\x05sizer\x18\x94\xf4\x03\x20\ + \x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x05sizer:L\n\x10unsafe\ + _marshaler\x18\x97\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageO\ + ptionsR\x0funsafeMarshaler:P\n\x12unsafe_unmarshaler\x18\x98\xf4\x03\x20\ + \x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x11unsafeUnmarshaler:W\ + \n\x16goproto_extensions_map\x18\x99\xf4\x03\x20\x01(\x08\x12\x1f.google\ + .protobuf.MessageOptionsR\x14goprotoExtensionsMap:T\n\x14goproto_unrecog\ + nized\x18\x9a\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOption\ + sR\x13goprotoUnrecognized:A\n\nprotosizer\x18\x9c\xf4\x03\x20\x01(\x08\ + \x12\x1f.google.protobuf.MessageOptionsR\nprotosizer:;\n\x07compare\x18\ + \x9d\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x07com\ + pare:=\n\x08typedecl\x18\x9e\xf4\x03\x20\x01(\x08\x12\x1f.google.protobu\ + f.MessageOptionsR\x08typedecl:C\n\x0bmessagename\x18\xa1\xf4\x03\x20\x01\ + (\x08\x12\x1f.google.protobuf.MessageOptionsR\x0bmessagename:N\n\x11gopr\ + oto_sizecache\x18\xa2\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.Messa\ + geOptionsR\x10goprotoSizecache:J\n\x0fgoproto_unkeyed\x18\xa3\xf4\x03\ + \x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0egoprotoUnkeyed:\ + ;\n\x08nullable\x18\xe9\xfb\x03\x20\x01(\x08\x12\x1d.google.protobuf.Fie\ + ldOptionsR\x08nullable:5\n\x05embed\x18\xea\xfb\x03\x20\x01(\x08\x12\x1d\ + .google.protobuf.FieldOptionsR\x05embed:?\n\ncustomtype\x18\xeb\xfb\x03\ + \x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\ncustomtype:?\n\ncusto\ + mname\x18\xec\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\n\ + customname:9\n\x07jsontag\x18\xed\xfb\x03\x20\x01(\t\x12\x1d.google.prot\ + obuf.FieldOptionsR\x07jsontag:;\n\x08moretags\x18\xee\xfb\x03\x20\x01(\t\ + \x12\x1d.google.protobuf.FieldOptionsR\x08moretags:;\n\x08casttype\x18\ + \xef\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\x08casttyp\ + e:9\n\x07castkey\x18\xf0\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.Fiel\ + dOptionsR\x07castkey:=\n\tcastvalue\x18\xf1\xfb\x03\x20\x01(\t\x12\x1d.g\ + oogle.protobuf.FieldOptionsR\tcastvalue:9\n\x07stdtime\x18\xf2\xfb\x03\ + \x20\x01(\x08\x12\x1d.google.protobuf.FieldOptionsR\x07stdtime:A\n\x0bst\ + dduration\x18\xf3\xfb\x03\x20\x01(\x08\x12\x1d.google.protobuf.FieldOpti\ + onsR\x0bstdduration:?\n\nwktpointer\x18\xf4\xfb\x03\x20\x01(\x08\x12\x1d\ + .google.protobuf.FieldOptionsR\nwktpointer:C\n\x0ccastrepeated\x18\xf5\ + \xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\x0ccastrepeate\ + dBH\n\x13com.google.protobufB\nGoGoProtosZ%github.com/cosmos/gogoproto/g\ + ogoprotoJ\xc17\n\x07\x12\x05\x1c\0\x90\x01\x01\n\xff\n\n\x01\x0c\x12\x03\ + \x1c\0\x122\xf4\n\x20Protocol\x20Buffers\x20for\x20Go\x20with\x20Gadgets\ + \n\n\x20Copyright\x20(c)\x202013,\x20The\x20GoGo\x20Authors.\x20All\x20r\ + ights\x20reserved.\n\x20http://github.com/cosmos/gogoproto\n\n\x20Redist\ + ribution\x20and\x20use\x20in\x20source\x20and\x20binary\x20forms,\x20wit\ + h\x20or\x20without\n\x20modification,\x20are\x20permitted\x20provided\ + \x20that\x20the\x20following\x20conditions\x20are\n\x20met:\n\n\x20\x20\ + \x20\x20\x20*\x20Redistributions\x20of\x20source\x20code\x20must\x20reta\ + in\x20the\x20above\x20copyright\n\x20notice,\x20this\x20list\x20of\x20co\ + nditions\x20and\x20the\x20following\x20disclaimer.\n\x20\x20\x20\x20\x20\ + *\x20Redistributions\x20in\x20binary\x20form\x20must\x20reproduce\x20the\ + \x20above\n\x20copyright\x20notice,\x20this\x20list\x20of\x20conditions\ + \x20and\x20the\x20following\x20disclaimer\n\x20in\x20the\x20documentatio\ + n\x20and/or\x20other\x20materials\x20provided\x20with\x20the\n\x20distri\ + bution.\n\n\x20THIS\x20SOFTWARE\x20IS\x20PROVIDED\x20BY\x20THE\x20COPYRI\ + GHT\x20HOLDERS\x20AND\x20CONTRIBUTORS\n\x20\"AS\x20IS\"\x20AND\x20ANY\ + \x20EXPRESS\x20OR\x20IMPLIED\x20WARRANTIES,\x20INCLUDING,\x20BUT\x20NOT\ + \n\x20LIMITED\x20TO,\x20THE\x20IMPLIED\x20WARRANTIES\x20OF\x20MERCHANTAB\ + ILITY\x20AND\x20FITNESS\x20FOR\n\x20A\x20PARTICULAR\x20PURPOSE\x20ARE\ + \x20DISCLAIMED.\x20IN\x20NO\x20EVENT\x20SHALL\x20THE\x20COPYRIGHT\n\x20O\ + WNER\x20OR\x20CONTRIBUTORS\x20BE\x20LIABLE\x20FOR\x20ANY\x20DIRECT,\x20I\ + NDIRECT,\x20INCIDENTAL,\n\x20SPECIAL,\x20EXEMPLARY,\x20OR\x20CONSEQUENTI\ + AL\x20DAMAGES\x20(INCLUDING,\x20BUT\x20NOT\n\x20LIMITED\x20TO,\x20PROCUR\ + EMENT\x20OF\x20SUBSTITUTE\x20GOODS\x20OR\x20SERVICES;\x20LOSS\x20OF\x20U\ + SE,\n\x20DATA,\x20OR\x20PROFITS;\x20OR\x20BUSINESS\x20INTERRUPTION)\x20H\ + OWEVER\x20CAUSED\x20AND\x20ON\x20ANY\n\x20THEORY\x20OF\x20LIABILITY,\x20\ + WHETHER\x20IN\x20CONTRACT,\x20STRICT\x20LIABILITY,\x20OR\x20TORT\n\x20(I\ + NCLUDING\x20NEGLIGENCE\x20OR\x20OTHERWISE)\x20ARISING\x20IN\x20ANY\x20WA\ + Y\x20OUT\x20OF\x20THE\x20USE\n\x20OF\x20THIS\x20SOFTWARE,\x20EVEN\x20IF\ + \x20ADVISED\x20OF\x20THE\x20POSSIBILITY\x20OF\x20SUCH\x20DAMAGE.\n\n\x08\ + \n\x01\x02\x12\x03\x1d\0\x12\n\t\n\x02\x03\0\x12\x03\x1f\0*\n\x08\n\x01\ + \x08\x12\x03!\0,\n\t\n\x02\x08\x01\x12\x03!\0,\n\x08\n\x01\x08\x12\x03\"\ + \0+\n\t\n\x02\x08\x08\x12\x03\"\0+\n\x08\n\x01\x08\x12\x03#\0<\n\t\n\x02\ + \x08\x0b\x12\x03#\0<\n\t\n\x01\x07\x12\x04%\0+\x01\n\t\n\x02\x07\0\x12\ + \x03&\x082\n\n\n\x03\x07\0\x02\x12\x03%\x07\"\n\n\n\x03\x07\0\x04\x12\ + \x03&\x08\x10\n\n\n\x03\x07\0\x05\x12\x03&\x11\x15\n\n\n\x03\x07\0\x01\ + \x12\x03&\x16)\n\n\n\x03\x07\0\x03\x12\x03&,1\n\t\n\x02\x07\x01\x12\x03'\ + \x084\n\n\n\x03\x07\x01\x02\x12\x03%\x07\"\n\n\n\x03\x07\x01\x04\x12\x03\ + '\x08\x10\n\n\n\x03\x07\x01\x05\x12\x03'\x11\x15\n\n\n\x03\x07\x01\x01\ + \x12\x03'\x16+\n\n\n\x03\x07\x01\x03\x12\x03'.3\n\t\n\x02\x07\x02\x12\ + \x03(\x08,\n\n\n\x03\x07\x02\x02\x12\x03%\x07\"\n\n\n\x03\x07\x02\x04\ + \x12\x03(\x08\x10\n\n\n\x03\x07\x02\x05\x12\x03(\x11\x15\n\n\n\x03\x07\ + \x02\x01\x12\x03(\x16#\n\n\n\x03\x07\x02\x03\x12\x03(&+\n\t\n\x02\x07\ + \x03\x12\x03)\x080\n\n\n\x03\x07\x03\x02\x12\x03%\x07\"\n\n\n\x03\x07\ + \x03\x04\x12\x03)\x08\x10\n\n\n\x03\x07\x03\x05\x12\x03)\x11\x17\n\n\n\ + \x03\x07\x03\x01\x12\x03)\x18'\n\n\n\x03\x07\x03\x03\x12\x03)*/\n\t\n\ + \x02\x07\x04\x12\x03*\x08'\n\n\n\x03\x07\x04\x02\x12\x03%\x07\"\n\n\n\ + \x03\x07\x04\x04\x12\x03*\x08\x10\n\n\n\x03\x07\x04\x05\x12\x03*\x11\x15\ + \n\n\n\x03\x07\x04\x01\x12\x03*\x16\x1e\n\n\n\x03\x07\x04\x03\x12\x03*!&\ + \n\t\n\x01\x07\x12\x04-\0/\x01\n\t\n\x02\x07\x05\x12\x03.\x085\n\n\n\x03\ + \x07\x05\x02\x12\x03-\x07'\n\n\n\x03\x07\x05\x04\x12\x03.\x08\x10\n\n\n\ + \x03\x07\x05\x05\x12\x03.\x11\x17\n\n\n\x03\x07\x05\x01\x12\x03.\x18,\n\ + \n\n\x03\x07\x05\x03\x12\x03./4\n\t\n\x01\x07\x12\x041\0Y\x01\n\t\n\x02\ + \x07\x06\x12\x032\x082\n\n\n\x03\x07\x06\x02\x12\x031\x07\"\n\n\n\x03\ + \x07\x06\x04\x12\x032\x08\x10\n\n\n\x03\x07\x06\x05\x12\x032\x11\x15\n\n\ + \n\x03\x07\x06\x01\x12\x032\x16)\n\n\n\x03\x07\x06\x03\x12\x032,1\n\t\n\ + \x02\x07\x07\x12\x033\x086\n\n\n\x03\x07\x07\x02\x12\x031\x07\"\n\n\n\ + \x03\x07\x07\x04\x12\x033\x08\x10\n\n\n\x03\x07\x07\x05\x12\x033\x11\x15\ + \n\n\n\x03\x07\x07\x01\x12\x033\x16-\n\n\n\x03\x07\x07\x03\x12\x03305\n\ + \t\n\x02\x07\x08\x12\x034\x083\n\n\n\x03\x07\x08\x02\x12\x031\x07\"\n\n\ + \n\x03\x07\x08\x04\x12\x034\x08\x10\n\n\n\x03\x07\x08\x05\x12\x034\x11\ + \x15\n\n\n\x03\x07\x08\x01\x12\x034\x16*\n\n\n\x03\x07\x08\x03\x12\x034-\ + 2\n\t\n\x02\x07\t\x12\x035\x080\n\n\n\x03\x07\t\x02\x12\x031\x07\"\n\n\n\ + \x03\x07\t\x04\x12\x035\x08\x10\n\n\n\x03\x07\t\x05\x12\x035\x11\x15\n\n\ + \n\x03\x07\t\x01\x12\x035\x16'\n\n\n\x03\x07\t\x03\x12\x035*/\n\t\n\x02\ + \x07\n\x12\x036\x08'\n\n\n\x03\x07\n\x02\x12\x031\x07\"\n\n\n\x03\x07\n\ + \x04\x12\x036\x08\x10\n\n\n\x03\x07\n\x05\x12\x036\x11\x15\n\n\n\x03\x07\ + \n\x01\x12\x036\x16\x1e\n\n\n\x03\x07\n\x03\x12\x036!&\n\t\n\x02\x07\x0b\ + \x12\x037\x08+\n\n\n\x03\x07\x0b\x02\x12\x031\x07\"\n\n\n\x03\x07\x0b\ + \x04\x12\x037\x08\x10\n\n\n\x03\x07\x0b\x05\x12\x037\x11\x15\n\n\n\x03\ + \x07\x0b\x01\x12\x037\x16\"\n\n\n\x03\x07\x0b\x03\x12\x037%*\n\t\n\x02\ + \x07\x0c\x12\x038\x08+\n\n\n\x03\x07\x0c\x02\x12\x031\x07\"\n\n\n\x03\ + \x07\x0c\x04\x12\x038\x08\x10\n\n\n\x03\x07\x0c\x05\x12\x038\x11\x15\n\n\ + \n\x03\x07\x0c\x01\x12\x038\x16\"\n\n\n\x03\x07\x0c\x03\x12\x038%*\n\t\n\ + \x02\x07\r\x12\x039\x08+\n\n\n\x03\x07\r\x02\x12\x031\x07\"\n\n\n\x03\ + \x07\r\x04\x12\x039\x08\x10\n\n\n\x03\x07\r\x05\x12\x039\x11\x15\n\n\n\ + \x03\x07\r\x01\x12\x039\x16\"\n\n\n\x03\x07\r\x03\x12\x039%*\n\t\n\x02\ + \x07\x0e\x12\x03:\x08*\n\n\n\x03\x07\x0e\x02\x12\x031\x07\"\n\n\n\x03\ + \x07\x0e\x04\x12\x03:\x08\x10\n\n\n\x03\x07\x0e\x05\x12\x03:\x11\x15\n\n\ + \n\x03\x07\x0e\x01\x12\x03:\x16!\n\n\n\x03\x07\x0e\x03\x12\x03:$)\n\t\n\ + \x02\x07\x0f\x12\x03<\x08(\n\n\n\x03\x07\x0f\x02\x12\x031\x07\"\n\n\n\ + \x03\x07\x0f\x04\x12\x03<\x08\x10\n\n\n\x03\x07\x0f\x05\x12\x03<\x11\x15\ + \n\n\n\x03\x07\x0f\x01\x12\x03<\x16\x1f\n\n\n\x03\x07\x0f\x03\x12\x03<\"\ + '\n\t\n\x02\x07\x10\x12\x03=\x08.\n\n\n\x03\x07\x10\x02\x12\x031\x07\"\n\ + \n\n\x03\x07\x10\x04\x12\x03=\x08\x10\n\n\n\x03\x07\x10\x05\x12\x03=\x11\ + \x15\n\n\n\x03\x07\x10\x01\x12\x03=\x16%\n\n\n\x03\x07\x10\x03\x12\x03=(\ + -\n\t\n\x02\x07\x11\x12\x03>\x08*\n\n\n\x03\x07\x11\x02\x12\x031\x07\"\n\ + \n\n\x03\x07\x11\x04\x12\x03>\x08\x10\n\n\n\x03\x07\x11\x05\x12\x03>\x11\ + \x15\n\n\n\x03\x07\x11\x01\x12\x03>\x16!\n\n\n\x03\x07\x11\x03\x12\x03>$\ + )\n\t\n\x02\x07\x12\x12\x03?\x08+\n\n\n\x03\x07\x12\x02\x12\x031\x07\"\n\ + \n\n\x03\x07\x12\x04\x12\x03?\x08\x10\n\n\n\x03\x07\x12\x05\x12\x03?\x11\ + \x15\n\n\n\x03\x07\x12\x01\x12\x03?\x16\"\n\n\n\x03\x07\x12\x03\x12\x03?\ + %*\n\t\n\x02\x07\x13\x12\x03@\x08,\n\n\n\x03\x07\x13\x02\x12\x031\x07\"\ + \n\n\n\x03\x07\x13\x04\x12\x03@\x08\x10\n\n\n\x03\x07\x13\x05\x12\x03@\ + \x11\x15\n\n\n\x03\x07\x13\x01\x12\x03@\x16#\n\n\n\x03\x07\x13\x03\x12\ + \x03@&+\n\t\n\x02\x07\x14\x12\x03A\x08.\n\n\n\x03\x07\x14\x02\x12\x031\ + \x07\"\n\n\n\x03\x07\x14\x04\x12\x03A\x08\x10\n\n\n\x03\x07\x14\x05\x12\ + \x03A\x11\x15\n\n\n\x03\x07\x14\x01\x12\x03A\x16%\n\n\n\x03\x07\x14\x03\ + \x12\x03A(-\n\t\n\x02\x07\x15\x12\x03B\x083\n\n\n\x03\x07\x15\x02\x12\ + \x031\x07\"\n\n\n\x03\x07\x15\x04\x12\x03B\x08\x10\n\n\n\x03\x07\x15\x05\ + \x12\x03B\x11\x15\n\n\n\x03\x07\x15\x01\x12\x03B\x16*\n\n\n\x03\x07\x15\ + \x03\x12\x03B-2\n\t\n\x02\x07\x16\x12\x03D\x08(\n\n\n\x03\x07\x16\x02\ + \x12\x031\x07\"\n\n\n\x03\x07\x16\x04\x12\x03D\x08\x10\n\n\n\x03\x07\x16\ + \x05\x12\x03D\x11\x15\n\n\n\x03\x07\x16\x01\x12\x03D\x16\x1f\n\n\n\x03\ + \x07\x16\x03\x12\x03D\"'\n\t\n\x02\x07\x17\x12\x03F\x088\n\n\n\x03\x07\ + \x17\x02\x12\x031\x07\"\n\n\n\x03\x07\x17\x04\x12\x03F\x08\x10\n\n\n\x03\ + \x07\x17\x05\x12\x03F\x11\x15\n\n\n\x03\x07\x17\x01\x12\x03F\x16/\n\n\n\ + \x03\x07\x17\x03\x12\x03F27\n\t\n\x02\x07\x18\x12\x03G\x080\n\n\n\x03\ + \x07\x18\x02\x12\x031\x07\"\n\n\n\x03\x07\x18\x04\x12\x03G\x08\x10\n\n\n\ + \x03\x07\x18\x05\x12\x03G\x11\x15\n\n\n\x03\x07\x18\x01\x12\x03G\x16'\n\ + \n\n\x03\x07\x18\x03\x12\x03G*/\n\t\n\x02\x07\x19\x12\x03I\x083\n\n\n\ + \x03\x07\x19\x02\x12\x031\x07\"\n\n\n\x03\x07\x19\x04\x12\x03I\x08\x10\n\ + \n\n\x03\x07\x19\x05\x12\x03I\x11\x15\n\n\n\x03\x07\x19\x01\x12\x03I\x16\ + *\n\n\n\x03\x07\x19\x03\x12\x03I-2\n\t\n\x02\x07\x1a\x12\x03J\x085\n\n\n\ + \x03\x07\x1a\x02\x12\x031\x07\"\n\n\n\x03\x07\x1a\x04\x12\x03J\x08\x10\n\ + \n\n\x03\x07\x1a\x05\x12\x03J\x11\x15\n\n\n\x03\x07\x1a\x01\x12\x03J\x16\ + ,\n\n\n\x03\x07\x1a\x03\x12\x03J/4\n\t\n\x02\x07\x1b\x12\x03L\x089\n\n\n\ + \x03\x07\x1b\x02\x12\x031\x07\"\n\n\n\x03\x07\x1b\x04\x12\x03L\x08\x10\n\ + \n\n\x03\x07\x1b\x05\x12\x03L\x11\x15\n\n\n\x03\x07\x1b\x01\x12\x03L\x16\ + 0\n\n\n\x03\x07\x1b\x03\x12\x03L38\n\t\n\x02\x07\x1c\x12\x03M\x087\n\n\n\ + \x03\x07\x1c\x02\x12\x031\x07\"\n\n\n\x03\x07\x1c\x04\x12\x03M\x08\x10\n\ + \n\n\x03\x07\x1c\x05\x12\x03M\x11\x15\n\n\n\x03\x07\x1c\x01\x12\x03M\x16\ + .\n\n\n\x03\x07\x1c\x03\x12\x03M16\n\t\n\x02\x07\x1d\x12\x03N\x08/\n\n\n\ + \x03\x07\x1d\x02\x12\x031\x07\"\n\n\n\x03\x07\x1d\x04\x12\x03N\x08\x10\n\ + \n\n\x03\x07\x1d\x05\x12\x03N\x11\x15\n\n\n\x03\x07\x1d\x01\x12\x03N\x16\ + &\n\n\n\x03\x07\x1d\x03\x12\x03N).\n\t\n\x02\x07\x1e\x12\x03O\x08-\n\n\n\ + \x03\x07\x1e\x02\x12\x031\x07\"\n\n\n\x03\x07\x1e\x04\x12\x03O\x08\x10\n\ + \n\n\x03\x07\x1e\x05\x12\x03O\x11\x15\n\n\n\x03\x07\x1e\x01\x12\x03O\x16\ + $\n\n\n\x03\x07\x1e\x03\x12\x03O',\n\t\n\x02\x07\x1f\x12\x03P\x08*\n\n\n\ + \x03\x07\x1f\x02\x12\x031\x07\"\n\n\n\x03\x07\x1f\x04\x12\x03P\x08\x10\n\ + \n\n\x03\x07\x1f\x05\x12\x03P\x11\x15\n\n\n\x03\x07\x1f\x01\x12\x03P\x16\ + !\n\n\n\x03\x07\x1f\x03\x12\x03P$)\n\t\n\x02\x07\x20\x12\x03Q\x04'\n\n\n\ + \x03\x07\x20\x02\x12\x031\x07\"\n\n\n\x03\x07\x20\x04\x12\x03Q\x04\x0c\n\ + \n\n\x03\x07\x20\x05\x12\x03Q\r\x11\n\n\n\x03\x07\x20\x01\x12\x03Q\x12\ + \x1e\n\n\n\x03\x07\x20\x03\x12\x03Q!&\n\t\n\x02\x07!\x12\x03R\x04'\n\n\n\ + \x03\x07!\x02\x12\x031\x07\"\n\n\n\x03\x07!\x04\x12\x03R\x04\x0c\n\n\n\ + \x03\x07!\x05\x12\x03R\r\x11\n\n\n\x03\x07!\x01\x12\x03R\x12\x1e\n\n\n\ + \x03\x07!\x03\x12\x03R!&\n\t\n\x02\x07\"\x12\x03T\x083\n\n\n\x03\x07\"\ + \x02\x12\x031\x07\"\n\n\n\x03\x07\"\x04\x12\x03T\x08\x10\n\n\n\x03\x07\"\ + \x05\x12\x03T\x11\x15\n\n\n\x03\x07\"\x01\x12\x03T\x16*\n\n\n\x03\x07\"\ + \x03\x12\x03T-2\n\t\n\x02\x07#\x12\x03U\x08.\n\n\n\x03\x07#\x02\x12\x031\ + \x07\"\n\n\n\x03\x07#\x04\x12\x03U\x08\x10\n\n\n\x03\x07#\x05\x12\x03U\ + \x11\x15\n\n\n\x03\x07#\x01\x12\x03U\x16%\n\n\n\x03\x07#\x03\x12\x03U(-\ + \n\t\n\x02\x07$\x12\x03W\x084\n\n\n\x03\x07$\x02\x12\x031\x07\"\n\n\n\ + \x03\x07$\x04\x12\x03W\x08\x10\n\n\n\x03\x07$\x05\x12\x03W\x11\x15\n\n\n\ + \x03\x07$\x01\x12\x03W\x16+\n\n\n\x03\x07$\x03\x12\x03W.3\n\t\n\x02\x07%\ + \x12\x03X\x082\n\n\n\x03\x07%\x02\x12\x031\x07\"\n\n\n\x03\x07%\x04\x12\ + \x03X\x08\x10\n\n\n\x03\x07%\x05\x12\x03X\x11\x15\n\n\n\x03\x07%\x01\x12\ + \x03X\x16)\n\n\n\x03\x07%\x03\x12\x03X,1\n\t\n\x01\x07\x12\x04[\0~\x01\n\ + \t\n\x02\x07&\x12\x03\\\x08.\n\n\n\x03\x07&\x02\x12\x03[\x07%\n\n\n\x03\ + \x07&\x04\x12\x03\\\x08\x10\n\n\n\x03\x07&\x05\x12\x03\\\x11\x15\n\n\n\ + \x03\x07&\x01\x12\x03\\\x16%\n\n\n\x03\x07&\x03\x12\x03\\(-\n\t\n\x02\ + \x07'\x12\x03]\x08/\n\n\n\x03\x07'\x02\x12\x03[\x07%\n\n\n\x03\x07'\x04\ + \x12\x03]\x08\x10\n\n\n\x03\x07'\x05\x12\x03]\x11\x15\n\n\n\x03\x07'\x01\ + \x12\x03]\x16&\n\n\n\x03\x07'\x03\x12\x03]).\n\t\n\x02\x07(\x12\x03^\x08\ + ,\n\n\n\x03\x07(\x02\x12\x03[\x07%\n\n\n\x03\x07(\x04\x12\x03^\x08\x10\n\ + \n\n\x03\x07(\x05\x12\x03^\x11\x15\n\n\n\x03\x07(\x01\x12\x03^\x16#\n\n\ + \n\x03\x07(\x03\x12\x03^&+\n\t\n\x02\x07)\x12\x03_\x08#\n\n\n\x03\x07)\ + \x02\x12\x03[\x07%\n\n\n\x03\x07)\x04\x12\x03_\x08\x10\n\n\n\x03\x07)\ + \x05\x12\x03_\x11\x15\n\n\n\x03\x07)\x01\x12\x03_\x16\x1a\n\n\n\x03\x07)\ + \x03\x12\x03_\x1d\"\n\t\n\x02\x07*\x12\x03`\x08'\n\n\n\x03\x07*\x02\x12\ + \x03[\x07%\n\n\n\x03\x07*\x04\x12\x03`\x08\x10\n\n\n\x03\x07*\x05\x12\ + \x03`\x11\x15\n\n\n\x03\x07*\x01\x12\x03`\x16\x1e\n\n\n\x03\x07*\x03\x12\ + \x03`!&\n\t\n\x02\x07+\x12\x03a\x08'\n\n\n\x03\x07+\x02\x12\x03[\x07%\n\ + \n\n\x03\x07+\x04\x12\x03a\x08\x10\n\n\n\x03\x07+\x05\x12\x03a\x11\x15\n\ + \n\n\x03\x07+\x01\x12\x03a\x16\x1e\n\n\n\x03\x07+\x03\x12\x03a!&\n\t\n\ + \x02\x07,\x12\x03b\x08'\n\n\n\x03\x07,\x02\x12\x03[\x07%\n\n\n\x03\x07,\ + \x04\x12\x03b\x08\x10\n\n\n\x03\x07,\x05\x12\x03b\x11\x15\n\n\n\x03\x07,\ + \x01\x12\x03b\x16\x1e\n\n\n\x03\x07,\x03\x12\x03b!&\n\t\n\x02\x07-\x12\ + \x03c\x08&\n\n\n\x03\x07-\x02\x12\x03[\x07%\n\n\n\x03\x07-\x04\x12\x03c\ + \x08\x10\n\n\n\x03\x07-\x05\x12\x03c\x11\x15\n\n\n\x03\x07-\x01\x12\x03c\ + \x16\x1d\n\n\n\x03\x07-\x03\x12\x03c\x20%\n\t\n\x02\x07.\x12\x03e\x08$\n\ + \n\n\x03\x07.\x02\x12\x03[\x07%\n\n\n\x03\x07.\x04\x12\x03e\x08\x10\n\n\ + \n\x03\x07.\x05\x12\x03e\x11\x15\n\n\n\x03\x07.\x01\x12\x03e\x16\x1b\n\n\ + \n\x03\x07.\x03\x12\x03e\x1e#\n\t\n\x02\x07/\x12\x03f\x08*\n\n\n\x03\x07\ + /\x02\x12\x03[\x07%\n\n\n\x03\x07/\x04\x12\x03f\x08\x10\n\n\n\x03\x07/\ + \x05\x12\x03f\x11\x15\n\n\n\x03\x07/\x01\x12\x03f\x16!\n\n\n\x03\x07/\ + \x03\x12\x03f$)\n\t\n\x02\x070\x12\x03g\x08&\n\n\n\x03\x070\x02\x12\x03[\ + \x07%\n\n\n\x03\x070\x04\x12\x03g\x08\x10\n\n\n\x03\x070\x05\x12\x03g\ + \x11\x15\n\n\n\x03\x070\x01\x12\x03g\x16\x1d\n\n\n\x03\x070\x03\x12\x03g\ + \x20%\n\t\n\x02\x071\x12\x03h\x08'\n\n\n\x03\x071\x02\x12\x03[\x07%\n\n\ + \n\x03\x071\x04\x12\x03h\x08\x10\n\n\n\x03\x071\x05\x12\x03h\x11\x15\n\n\ + \n\x03\x071\x01\x12\x03h\x16\x1e\n\n\n\x03\x071\x03\x12\x03h!&\n\t\n\x02\ + \x072\x12\x03i\x08(\n\n\n\x03\x072\x02\x12\x03[\x07%\n\n\n\x03\x072\x04\ + \x12\x03i\x08\x10\n\n\n\x03\x072\x05\x12\x03i\x11\x15\n\n\n\x03\x072\x01\ + \x12\x03i\x16\x1f\n\n\n\x03\x072\x03\x12\x03i\"'\n\t\n\x02\x073\x12\x03j\ + \x08*\n\n\n\x03\x073\x02\x12\x03[\x07%\n\n\n\x03\x073\x04\x12\x03j\x08\ + \x10\n\n\n\x03\x073\x05\x12\x03j\x11\x15\n\n\n\x03\x073\x01\x12\x03j\x16\ + !\n\n\n\x03\x073\x03\x12\x03j$)\n\t\n\x02\x074\x12\x03k\x08/\n\n\n\x03\ + \x074\x02\x12\x03[\x07%\n\n\n\x03\x074\x04\x12\x03k\x08\x10\n\n\n\x03\ + \x074\x05\x12\x03k\x11\x15\n\n\n\x03\x074\x01\x12\x03k\x16&\n\n\n\x03\ + \x074\x03\x12\x03k).\n\t\n\x02\x075\x12\x03m\x08$\n\n\n\x03\x075\x02\x12\ + \x03[\x07%\n\n\n\x03\x075\x04\x12\x03m\x08\x10\n\n\n\x03\x075\x05\x12\ + \x03m\x11\x15\n\n\n\x03\x075\x01\x12\x03m\x16\x1b\n\n\n\x03\x075\x03\x12\ + \x03m\x1e#\n\t\n\x02\x076\x12\x03o\x08/\n\n\n\x03\x076\x02\x12\x03[\x07%\ + \n\n\n\x03\x076\x04\x12\x03o\x08\x10\n\n\n\x03\x076\x05\x12\x03o\x11\x15\ + \n\n\n\x03\x076\x01\x12\x03o\x16&\n\n\n\x03\x076\x03\x12\x03o).\n\t\n\ + \x02\x077\x12\x03p\x081\n\n\n\x03\x077\x02\x12\x03[\x07%\n\n\n\x03\x077\ + \x04\x12\x03p\x08\x10\n\n\n\x03\x077\x05\x12\x03p\x11\x15\n\n\n\x03\x077\ + \x01\x12\x03p\x16(\n\n\n\x03\x077\x03\x12\x03p+0\n\t\n\x02\x078\x12\x03r\ + \x085\n\n\n\x03\x078\x02\x12\x03[\x07%\n\n\n\x03\x078\x04\x12\x03r\x08\ + \x10\n\n\n\x03\x078\x05\x12\x03r\x11\x15\n\n\n\x03\x078\x01\x12\x03r\x16\ + ,\n\n\n\x03\x078\x03\x12\x03r/4\n\t\n\x02\x079\x12\x03s\x083\n\n\n\x03\ + \x079\x02\x12\x03[\x07%\n\n\n\x03\x079\x04\x12\x03s\x08\x10\n\n\n\x03\ + \x079\x05\x12\x03s\x11\x15\n\n\n\x03\x079\x01\x12\x03s\x16*\n\n\n\x03\ + \x079\x03\x12\x03s-2\n\t\n\x02\x07:\x12\x03u\x08)\n\n\n\x03\x07:\x02\x12\ + \x03[\x07%\n\n\n\x03\x07:\x04\x12\x03u\x08\x10\n\n\n\x03\x07:\x05\x12\ + \x03u\x11\x15\n\n\n\x03\x07:\x01\x12\x03u\x16\x20\n\n\n\x03\x07:\x03\x12\ + \x03u#(\n\t\n\x02\x07;\x12\x03v\x08&\n\n\n\x03\x07;\x02\x12\x03[\x07%\n\ + \n\n\x03\x07;\x04\x12\x03v\x08\x10\n\n\n\x03\x07;\x05\x12\x03v\x11\x15\n\ + \n\n\x03\x07;\x01\x12\x03v\x16\x1d\n\n\n\x03\x07;\x03\x12\x03v\x20%\n\t\ + \n\x02\x07<\x12\x03x\x08'\n\n\n\x03\x07<\x02\x12\x03[\x07%\n\n\n\x03\x07\ + <\x04\x12\x03x\x08\x10\n\n\n\x03\x07<\x05\x12\x03x\x11\x15\n\n\n\x03\x07\ + <\x01\x12\x03x\x16\x1e\n\n\n\x03\x07<\x03\x12\x03x!&\n\t\n\x02\x07=\x12\ + \x03z\x08*\n\n\n\x03\x07=\x02\x12\x03[\x07%\n\n\n\x03\x07=\x04\x12\x03z\ + \x08\x10\n\n\n\x03\x07=\x05\x12\x03z\x11\x15\n\n\n\x03\x07=\x01\x12\x03z\ + \x16!\n\n\n\x03\x07=\x03\x12\x03z$)\n\t\n\x02\x07>\x12\x03|\x080\n\n\n\ + \x03\x07>\x02\x12\x03[\x07%\n\n\n\x03\x07>\x04\x12\x03|\x08\x10\n\n\n\ + \x03\x07>\x05\x12\x03|\x11\x15\n\n\n\x03\x07>\x01\x12\x03|\x16'\n\n\n\ + \x03\x07>\x03\x12\x03|*/\n\t\n\x02\x07?\x12\x03}\x08.\n\n\n\x03\x07?\x02\ + \x12\x03[\x07%\n\n\n\x03\x07?\x04\x12\x03}\x08\x10\n\n\n\x03\x07?\x05\ + \x12\x03}\x11\x15\n\n\n\x03\x07?\x01\x12\x03}\x16%\n\n\n\x03\x07?\x03\ + \x12\x03}(-\n\x0b\n\x01\x07\x12\x06\x80\x01\0\x90\x01\x01\n\n\n\x02\x07@\ + \x12\x04\x81\x01\x08'\n\x0b\n\x03\x07@\x02\x12\x04\x80\x01\x07#\n\x0b\n\ + \x03\x07@\x04\x12\x04\x81\x01\x08\x10\n\x0b\n\x03\x07@\x05\x12\x04\x81\ + \x01\x11\x15\n\x0b\n\x03\x07@\x01\x12\x04\x81\x01\x16\x1e\n\x0b\n\x03\ + \x07@\x03\x12\x04\x81\x01!&\n\n\n\x02\x07A\x12\x04\x82\x01\x08$\n\x0b\n\ + \x03\x07A\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07A\x04\x12\x04\x82\x01\ + \x08\x10\n\x0b\n\x03\x07A\x05\x12\x04\x82\x01\x11\x15\n\x0b\n\x03\x07A\ + \x01\x12\x04\x82\x01\x16\x1b\n\x0b\n\x03\x07A\x03\x12\x04\x82\x01\x1e#\n\ + \n\n\x02\x07B\x12\x04\x83\x01\x08+\n\x0b\n\x03\x07B\x02\x12\x04\x80\x01\ + \x07#\n\x0b\n\x03\x07B\x04\x12\x04\x83\x01\x08\x10\n\x0b\n\x03\x07B\x05\ + \x12\x04\x83\x01\x11\x17\n\x0b\n\x03\x07B\x01\x12\x04\x83\x01\x18\"\n\ + \x0b\n\x03\x07B\x03\x12\x04\x83\x01%*\n\n\n\x02\x07C\x12\x04\x84\x01\x08\ + +\n\x0b\n\x03\x07C\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07C\x04\x12\x04\ + \x84\x01\x08\x10\n\x0b\n\x03\x07C\x05\x12\x04\x84\x01\x11\x17\n\x0b\n\ + \x03\x07C\x01\x12\x04\x84\x01\x18\"\n\x0b\n\x03\x07C\x03\x12\x04\x84\x01\ + %*\n\n\n\x02\x07D\x12\x04\x85\x01\x08(\n\x0b\n\x03\x07D\x02\x12\x04\x80\ + \x01\x07#\n\x0b\n\x03\x07D\x04\x12\x04\x85\x01\x08\x10\n\x0b\n\x03\x07D\ + \x05\x12\x04\x85\x01\x11\x17\n\x0b\n\x03\x07D\x01\x12\x04\x85\x01\x18\ + \x1f\n\x0b\n\x03\x07D\x03\x12\x04\x85\x01\"'\n\n\n\x02\x07E\x12\x04\x86\ + \x01\x08)\n\x0b\n\x03\x07E\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07E\x04\ + \x12\x04\x86\x01\x08\x10\n\x0b\n\x03\x07E\x05\x12\x04\x86\x01\x11\x17\n\ + \x0b\n\x03\x07E\x01\x12\x04\x86\x01\x18\x20\n\x0b\n\x03\x07E\x03\x12\x04\ + \x86\x01#(\n\n\n\x02\x07F\x12\x04\x87\x01\x08)\n\x0b\n\x03\x07F\x02\x12\ + \x04\x80\x01\x07#\n\x0b\n\x03\x07F\x04\x12\x04\x87\x01\x08\x10\n\x0b\n\ + \x03\x07F\x05\x12\x04\x87\x01\x11\x17\n\x0b\n\x03\x07F\x01\x12\x04\x87\ + \x01\x18\x20\n\x0b\n\x03\x07F\x03\x12\x04\x87\x01#(\n\n\n\x02\x07G\x12\ + \x04\x88\x01\x08(\n\x0b\n\x03\x07G\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\ + \x07G\x04\x12\x04\x88\x01\x08\x10\n\x0b\n\x03\x07G\x05\x12\x04\x88\x01\ + \x11\x17\n\x0b\n\x03\x07G\x01\x12\x04\x88\x01\x18\x1f\n\x0b\n\x03\x07G\ + \x03\x12\x04\x88\x01\"'\n\n\n\x02\x07H\x12\x04\x89\x01\x08*\n\x0b\n\x03\ + \x07H\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07H\x04\x12\x04\x89\x01\x08\ + \x10\n\x0b\n\x03\x07H\x05\x12\x04\x89\x01\x11\x17\n\x0b\n\x03\x07H\x01\ + \x12\x04\x89\x01\x18!\n\x0b\n\x03\x07H\x03\x12\x04\x89\x01$)\n\n\n\x02\ + \x07I\x12\x04\x8b\x01\x08&\n\x0b\n\x03\x07I\x02\x12\x04\x80\x01\x07#\n\ + \x0b\n\x03\x07I\x04\x12\x04\x8b\x01\x08\x10\n\x0b\n\x03\x07I\x05\x12\x04\ + \x8b\x01\x11\x15\n\x0b\n\x03\x07I\x01\x12\x04\x8b\x01\x16\x1d\n\x0b\n\ + \x03\x07I\x03\x12\x04\x8b\x01\x20%\n\n\n\x02\x07J\x12\x04\x8c\x01\x08*\n\ + \x0b\n\x03\x07J\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07J\x04\x12\x04\ + \x8c\x01\x08\x10\n\x0b\n\x03\x07J\x05\x12\x04\x8c\x01\x11\x15\n\x0b\n\ + \x03\x07J\x01\x12\x04\x8c\x01\x16!\n\x0b\n\x03\x07J\x03\x12\x04\x8c\x01$\ + )\n\n\n\x02\x07K\x12\x04\x8d\x01\x08)\n\x0b\n\x03\x07K\x02\x12\x04\x80\ + \x01\x07#\n\x0b\n\x03\x07K\x04\x12\x04\x8d\x01\x08\x10\n\x0b\n\x03\x07K\ + \x05\x12\x04\x8d\x01\x11\x15\n\x0b\n\x03\x07K\x01\x12\x04\x8d\x01\x16\ + \x20\n\x0b\n\x03\x07K\x03\x12\x04\x8d\x01#(\n\n\n\x02\x07L\x12\x04\x8f\ + \x01\x08-\n\x0b\n\x03\x07L\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07L\x04\ + \x12\x04\x8f\x01\x08\x10\n\x0b\n\x03\x07L\x05\x12\x04\x8f\x01\x11\x17\n\ + \x0b\n\x03\x07L\x01\x12\x04\x8f\x01\x18$\n\x0b\n\x03\x07L\x03\x12\x04\ + \x8f\x01',\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(1); + deps.push(::protobuf::descriptor::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(0); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs b/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs new file mode 100644 index 00000000..4e01b326 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs @@ -0,0 +1,221 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/limit_order_expiration.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.LimitOrderExpiration) +pub struct LimitOrderExpiration { + // message fields + /// see limitOrderTranche.proto for details on goodTilDate + // @@protoc_insertion_point(field:neutron.dex.LimitOrderExpiration.expiration_time) + pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderExpiration.tranche_ref) + pub tranche_ref: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderExpiration.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LimitOrderExpiration { + fn default() -> &'a LimitOrderExpiration { + ::default_instance() + } +} + +impl LimitOrderExpiration { + pub fn new() -> LimitOrderExpiration { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( + "expiration_time", + |m: &LimitOrderExpiration| { &m.expiration_time }, + |m: &mut LimitOrderExpiration| { &mut m.expiration_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tranche_ref", + |m: &LimitOrderExpiration| { &m.tranche_ref }, + |m: &mut LimitOrderExpiration| { &mut m.tranche_ref }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LimitOrderExpiration", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LimitOrderExpiration { + const NAME: &'static str = "LimitOrderExpiration"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; + }, + 18 => { + self.tranche_ref = is.read_bytes()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.expiration_time.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.tranche_ref.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.tranche_ref); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.expiration_time.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if !self.tranche_ref.is_empty() { + os.write_bytes(2, &self.tranche_ref)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> LimitOrderExpiration { + LimitOrderExpiration::new() + } + + fn clear(&mut self) { + self.expiration_time.clear(); + self.tranche_ref.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static LimitOrderExpiration { + static instance: LimitOrderExpiration = LimitOrderExpiration { + expiration_time: ::protobuf::MessageField::none(), + tranche_ref: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LimitOrderExpiration { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderExpiration").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LimitOrderExpiration { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LimitOrderExpiration { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n(neutron/dex/limit_order_expiration.proto\x12\x0bneutron.dex\x1a\x1fgo\ + ogle/protobuf/timestamp.proto\x1a\x14gogoproto/gogo.proto\"\x86\x01\n\ + \x14LimitOrderExpiration\x12M\n\x0fexpiration_time\x18\x01\x20\x01(\x0b2\ + \x1a.google.protobuf.TimestampR\x0eexpirationTimeB\x08\x90\xdf\x1f\x01\ + \xc8\xde\x1f\0\x12\x1f\n\x0btranche_ref\x18\x02\x20\x01(\x0cR\ntrancheRe\ + fB,Z*github.com/neutron-org/neutron/x/dex/typesJ\xb9\x02\n\x06\x12\x04\0\ + \0\x10\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\ + \x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\ + \n\x02\x03\0\x12\x03\x04\0)\n\t\n\x02\x03\x01\x12\x03\x06\0\x1e\n\n\n\ + \x02\x04\0\x12\x04\x08\0\x10\x01\n\n\n\x03\x04\0\x01\x12\x03\x08\x08\x1c\ + \nF\n\x04\x04\0\x02\0\x12\x04\n\x02\r1\x1a8\x20see\x20limitOrderTranche.\ + proto\x20for\x20details\x20on\x20goodTilDate\n\n\x0c\n\x05\x04\0\x02\0\ + \x06\x12\x03\n\x02\x1b\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x1c+\n\x0c\ + \n\x05\x04\0\x02\0\x03\x12\x03\n./\n\r\n\x05\x04\0\x02\0\x08\x12\x04\n0\ + \r0\n\x0f\n\x08\x04\0\x02\0\x08\xf2\xfb\x03\x12\x03\x0b/I\n\x0f\n\x08\ + \x04\0\x02\0\x08\xe9\xfb\x03\x12\x03\x0c/K\n\x0b\n\x04\x04\0\x02\x01\x12\ + \x03\x0e\x02\x18\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x0e\x02\x07\n\x0c\ + \n\x05\x04\0\x02\x01\x01\x12\x03\x0e\x08\x13\n\x0c\n\x05\x04\0\x02\x01\ + \x03\x12\x03\x0e\x16\x17b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(2); + deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); + deps.push(super::gogo::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(LimitOrderExpiration::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs b/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs new file mode 100644 index 00000000..2b8cbfed --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs @@ -0,0 +1,550 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/limit_order_tranche.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.LimitOrderTrancheKey) +pub struct LimitOrderTrancheKey { + // message fields + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.trade_pair_id) + pub trade_pair_id: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.tick_index_taker_to_maker) + pub tick_index_taker_to_maker: i64, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.tranche_key) + pub tranche_key: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTrancheKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LimitOrderTrancheKey { + fn default() -> &'a LimitOrderTrancheKey { + ::default_instance() + } +} + +impl LimitOrderTrancheKey { + pub fn new() -> LimitOrderTrancheKey { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( + "trade_pair_id", + |m: &LimitOrderTrancheKey| { &m.trade_pair_id }, + |m: &mut LimitOrderTrancheKey| { &mut m.trade_pair_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tick_index_taker_to_maker", + |m: &LimitOrderTrancheKey| { &m.tick_index_taker_to_maker }, + |m: &mut LimitOrderTrancheKey| { &mut m.tick_index_taker_to_maker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tranche_key", + |m: &LimitOrderTrancheKey| { &m.tranche_key }, + |m: &mut LimitOrderTrancheKey| { &mut m.tranche_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LimitOrderTrancheKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LimitOrderTrancheKey { + const NAME: &'static str = "LimitOrderTrancheKey"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; + }, + 16 => { + self.tick_index_taker_to_maker = is.read_int64()?; + }, + 26 => { + self.tranche_key = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.trade_pair_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if self.tick_index_taker_to_maker != 0 { + my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); + } + if !self.tranche_key.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.tranche_key); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.trade_pair_id.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if self.tick_index_taker_to_maker != 0 { + os.write_int64(2, self.tick_index_taker_to_maker)?; + } + if !self.tranche_key.is_empty() { + os.write_string(3, &self.tranche_key)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> LimitOrderTrancheKey { + LimitOrderTrancheKey::new() + } + + fn clear(&mut self) { + self.trade_pair_id.clear(); + self.tick_index_taker_to_maker = 0; + self.tranche_key.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static LimitOrderTrancheKey { + static instance: LimitOrderTrancheKey = LimitOrderTrancheKey { + trade_pair_id: ::protobuf::MessageField::none(), + tick_index_taker_to_maker: 0, + tranche_key: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LimitOrderTrancheKey { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTrancheKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LimitOrderTrancheKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LimitOrderTrancheKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.LimitOrderTranche) +pub struct LimitOrderTranche { + // message fields + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.key) + pub key: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.reserves_maker_denom) + pub reserves_maker_denom: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.reserves_taker_denom) + pub reserves_taker_denom: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.total_maker_denom) + pub total_maker_denom: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.total_taker_denom) + pub total_taker_denom: ::std::string::String, + /// JIT orders also use goodTilDate to handle deletion but represent a special case + /// All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live + /// Order deletion still functions the same and the orders will be deleted at the end of the block + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.expiration_time) + pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.price_taker_to_maker) + pub price_taker_to_maker: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTranche.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LimitOrderTranche { + fn default() -> &'a LimitOrderTranche { + ::default_instance() + } +} + +impl LimitOrderTranche { + pub fn new() -> LimitOrderTranche { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, LimitOrderTrancheKey>( + "key", + |m: &LimitOrderTranche| { &m.key }, + |m: &mut LimitOrderTranche| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "reserves_maker_denom", + |m: &LimitOrderTranche| { &m.reserves_maker_denom }, + |m: &mut LimitOrderTranche| { &mut m.reserves_maker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "reserves_taker_denom", + |m: &LimitOrderTranche| { &m.reserves_taker_denom }, + |m: &mut LimitOrderTranche| { &mut m.reserves_taker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "total_maker_denom", + |m: &LimitOrderTranche| { &m.total_maker_denom }, + |m: &mut LimitOrderTranche| { &mut m.total_maker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "total_taker_denom", + |m: &LimitOrderTranche| { &m.total_taker_denom }, + |m: &mut LimitOrderTranche| { &mut m.total_taker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( + "expiration_time", + |m: &LimitOrderTranche| { &m.expiration_time }, + |m: &mut LimitOrderTranche| { &mut m.expiration_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "price_taker_to_maker", + |m: &LimitOrderTranche| { &m.price_taker_to_maker }, + |m: &mut LimitOrderTranche| { &mut m.price_taker_to_maker }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LimitOrderTranche", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LimitOrderTranche { + const NAME: &'static str = "LimitOrderTranche"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.key)?; + }, + 18 => { + self.reserves_maker_denom = is.read_string()?; + }, + 26 => { + self.reserves_taker_denom = is.read_string()?; + }, + 34 => { + self.total_maker_denom = is.read_string()?; + }, + 42 => { + self.total_taker_denom = is.read_string()?; + }, + 50 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; + }, + 58 => { + self.price_taker_to_maker = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.key.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.reserves_maker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.reserves_maker_denom); + } + if !self.reserves_taker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.reserves_taker_denom); + } + if !self.total_maker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.total_maker_denom); + } + if !self.total_taker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(5, &self.total_taker_denom); + } + if let Some(v) = self.expiration_time.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.price_taker_to_maker.is_empty() { + my_size += ::protobuf::rt::string_size(7, &self.price_taker_to_maker); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.key.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if !self.reserves_maker_denom.is_empty() { + os.write_string(2, &self.reserves_maker_denom)?; + } + if !self.reserves_taker_denom.is_empty() { + os.write_string(3, &self.reserves_taker_denom)?; + } + if !self.total_maker_denom.is_empty() { + os.write_string(4, &self.total_maker_denom)?; + } + if !self.total_taker_denom.is_empty() { + os.write_string(5, &self.total_taker_denom)?; + } + if let Some(v) = self.expiration_time.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; + } + if !self.price_taker_to_maker.is_empty() { + os.write_string(7, &self.price_taker_to_maker)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> LimitOrderTranche { + LimitOrderTranche::new() + } + + fn clear(&mut self) { + self.key.clear(); + self.reserves_maker_denom.clear(); + self.reserves_taker_denom.clear(); + self.total_maker_denom.clear(); + self.total_taker_denom.clear(); + self.expiration_time.clear(); + self.price_taker_to_maker.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static LimitOrderTranche { + static instance: LimitOrderTranche = LimitOrderTranche { + key: ::protobuf::MessageField::none(), + reserves_maker_denom: ::std::string::String::new(), + reserves_taker_denom: ::std::string::String::new(), + total_maker_denom: ::std::string::String::new(), + total_taker_denom: ::std::string::String::new(), + expiration_time: ::protobuf::MessageField::none(), + price_taker_to_maker: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LimitOrderTranche { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTranche").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LimitOrderTranche { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LimitOrderTranche { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n%neutron/dex/limit_order_tranche.proto\x12\x0bneutron.dex\x1a\x1fgoogl\ + e/protobuf/timestamp.proto\x1a\x1fneutron/dex/trade_pair_id.proto\x1a\ + \x14gogoproto/gogo.proto\x1a\x19neutron/dex/pair_id.proto\"\xaf\x01\n\ + \x14LimitOrderTrancheKey\x12<\n\rtrade_pair_id\x18\x01\x20\x01(\x0b2\x18\ + .neutron.dex.TradePairIDR\x0btradePairId\x128\n\x19tick_index_taker_to_m\ + aker\x18\x02\x20\x01(\x03R\x15tickIndexTakerToMaker\x12\x1f\n\x0btranche\ + _key\x18\x03\x20\x01(\tR\ntrancheKey\"\x8b\x07\n\x11LimitOrderTranche\ + \x123\n\x03key\x18\x01\x20\x01(\x0b2!.neutron.dex.LimitOrderTrancheKeyR\ + \x03key\x12\x97\x01\n\x14reserves_maker_denom\x18\x02\x20\x01(\tR\x12res\ + ervesMakerDenomBe\xf2\xde\x1f\x1byaml:\"reserves_maker_denom\"\xda\xde\ + \x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\ + \x14reserves_maker_denom\x12\x97\x01\n\x14reserves_taker_denom\x18\x03\ + \x20\x01(\tR\x12reservesTakerDenomBe\xf2\xde\x1f\x1byaml:\"reserves_take\ + r_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\ + \0\xea\xde\x1f\x14reserves_taker_denom\x12\x8b\x01\n\x11total_maker_deno\ + m\x18\x04\x20\x01(\tR\x0ftotalMakerDenomB_\xf2\xde\x1f\x18yaml:\"total_m\ + aker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\ + \x1f\0\xea\xde\x1f\x11total_maker_denom\x12\x8b\x01\n\x11total_taker_den\ + om\x18\x05\x20\x01(\tR\x0ftotalTakerDenomB_\xf2\xde\x1f\x18yaml:\"total_\ + taker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\ + \x1f\0\xea\xde\x1f\x11total_taker_denom\x12M\n\x0fexpiration_time\x18\ + \x06\x20\x01(\x0b2\x1a.google.protobuf.TimestampR\x0eexpirationTimeB\x08\ + \x90\xdf\x1f\x01\xc8\xde\x1f\x01\x12\xa1\x01\n\x14price_taker_to_maker\ + \x18\x07\x20\x01(\tR\x11priceTakerToMakerBp\xf2\xde\x1f\x1byaml:\"price_\ + taker_to_maker\"\xda\xde\x1f1github.com/neutron-org/neutron/utils/math.P\ + recDec\xc8\xde\x1f\0\xea\xde\x1f\x14price_taker_to_makerB,Z*github.com/n\ + eutron-org/neutron/x/dex/typesJ\xce\x0c\n\x06\x12\x04\0\0:\x01\n\x08\n\ + \x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\ + \x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\ + \x03\x04\0)\n\t\n\x02\x03\x01\x12\x03\x06\0)\n\t\n\x02\x03\x02\x12\x03\ + \x07\0\x1e\n\t\n\x02\x03\x03\x12\x03\x08\0#\n\n\n\x02\x04\0\x12\x04\n\0\ + \x0e\x01\n\n\n\x03\x04\0\x01\x12\x03\n\x08\x1c\n\x0b\n\x04\x04\0\x02\0\ + \x12\x03\x0b\x02\x20\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0b\x02\r\n\x0c\ + \n\x05\x04\0\x02\0\x01\x12\x03\x0b\x0e\x1b\n\x0c\n\x05\x04\0\x02\0\x03\ + \x12\x03\x0b\x1e\x1f\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0c\x02&\n\x0c\n\ + \x05\x04\0\x02\x01\x05\x12\x03\x0c\x02\x07\n\x0c\n\x05\x04\0\x02\x01\x01\ + \x12\x03\x0c\x08!\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0c$%\n\x0b\n\ + \x04\x04\0\x02\x02\x12\x03\r\x02\x19\n\x0c\n\x05\x04\0\x02\x02\x05\x12\ + \x03\r\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\r\t\x14\n\x0c\n\x05\ + \x04\0\x02\x02\x03\x12\x03\r\x17\x18\n\n\n\x02\x04\x01\x12\x04\x10\0:\ + \x01\n\n\n\x03\x04\x01\x01\x12\x03\x10\x08\x19\n\x0b\n\x04\x04\x01\x02\0\ + \x12\x03\x11\x02\x1f\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x11\x02\x16\n\ + \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x11\x17\x1a\n\x0c\n\x05\x04\x01\x02\ + \0\x03\x12\x03\x11\x1d\x1e\n\x0c\n\x04\x04\x01\x02\x01\x12\x04\x12\x02\ + \x17\x04\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x12\x02\x08\n\x0c\n\x05\ + \x04\x01\x02\x01\x01\x12\x03\x12\t\x1d\n\x0c\n\x05\x04\x01\x02\x01\x03\ + \x12\x03\x12\x20!\n\r\n\x05\x04\x01\x02\x01\x08\x12\x04\x12#\x17\x03\n\ + \x0f\n\x08\x04\x01\x02\x01\x08\xee\xfb\x03\x12\x03\x13\x06>\n\x0f\n\x08\ + \x04\x01\x02\x01\x08\xeb\xfb\x03\x12\x03\x14\x06G\n\x0f\n\x08\x04\x01\ + \x02\x01\x08\xe9\xfb\x03\x12\x03\x15\x06$\n\x0f\n\x08\x04\x01\x02\x01\ + \x08\xed\xfb\x03\x12\x03\x16\x062\n\x0c\n\x04\x04\x01\x02\x02\x12\x04\ + \x18\x02\x1d\x04\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x18\x02\x08\n\ + \x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x18\t\x1d\n\x0c\n\x05\x04\x01\x02\ + \x02\x03\x12\x03\x18\x20!\n\r\n\x05\x04\x01\x02\x02\x08\x12\x04\x18#\x1d\ + \x03\n\x0f\n\x08\x04\x01\x02\x02\x08\xee\xfb\x03\x12\x03\x19\x06>\n\x0f\ + \n\x08\x04\x01\x02\x02\x08\xeb\xfb\x03\x12\x03\x1a\x06G\n\x0f\n\x08\x04\ + \x01\x02\x02\x08\xe9\xfb\x03\x12\x03\x1b\x06$\n\x0f\n\x08\x04\x01\x02\ + \x02\x08\xed\xfb\x03\x12\x03\x1c\x062\n\x0c\n\x04\x04\x01\x02\x03\x12\ + \x04\x1e\x02#\x04\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x1e\x02\x08\n\ + \x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x1e\t\x1a\n\x0c\n\x05\x04\x01\x02\ + \x03\x03\x12\x03\x1e\x1d\x1e\n\r\n\x05\x04\x01\x02\x03\x08\x12\x04\x1e\ + \x20#\x03\n\x0f\n\x08\x04\x01\x02\x03\x08\xee\xfb\x03\x12\x03\x1f\x06;\n\ + \x0f\n\x08\x04\x01\x02\x03\x08\xeb\xfb\x03\x12\x03\x20\x06G\n\x0f\n\x08\ + \x04\x01\x02\x03\x08\xe9\xfb\x03\x12\x03!\x06$\n\x0f\n\x08\x04\x01\x02\ + \x03\x08\xed\xfb\x03\x12\x03\"\x06/\n\xb0\x01\n\x04\x04\x01\x02\x04\x12\ + \x04$\x02)\x04\"\xa1\x01\x20GoodTilDate\x20is\x20represented\x20as\x20se\ + conds\x20since\x20\x20January\x201,\x20year\x201,\x2000:00:00.00\x20UTC\ + \n\x20LimitOrders\x20with\x20goodTilDate\x20set\x20are\x20valid\x20as\ + \x20long\x20as\x20blockTime\x20<=\x20goodTilDate\n\n\x0c\n\x05\x04\x01\ + \x02\x04\x05\x12\x03$\x02\x08\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03$\t\ + \x1a\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03$\x1d\x1e\n\r\n\x05\x04\x01\ + \x02\x04\x08\x12\x04$\x20)\x03\n\x0f\n\x08\x04\x01\x02\x04\x08\xee\xfb\ + \x03\x12\x03%\x06;\n\x0f\n\x08\x04\x01\x02\x04\x08\xeb\xfb\x03\x12\x03&\ + \x06G\n\x0f\n\x08\x04\x01\x02\x04\x08\xe9\xfb\x03\x12\x03'\x06$\n\x0f\n\ + \x08\x04\x01\x02\x04\x08\xed\xfb\x03\x12\x03(\x06/\n\xab\x02\n\x04\x04\ + \x01\x02\x05\x12\x040\x023/\x1a\x9c\x02\x20JIT\x20orders\x20also\x20use\ + \x20goodTilDate\x20to\x20handle\x20deletion\x20but\x20represent\x20a\x20\ + special\x20case\n\x20All\x20JIT\x20orders\x20have\x20a\x20goodTilDate\ + \x20of\x200\x20and\x20an\x20exception\x20is\x20made\x20to\x20still\x20st\ + ill\x20treat\x20these\x20orders\x20as\x20live\n\x20Order\x20deletion\x20\ + still\x20functions\x20the\x20same\x20and\x20the\x20orders\x20will\x20be\ + \x20deleted\x20at\x20the\x20end\x20of\x20the\x20block\n\n\x0c\n\x05\x04\ + \x01\x02\x05\x06\x12\x030\x02\x1b\n\x0c\n\x05\x04\x01\x02\x05\x01\x12\ + \x030\x1c+\n\x0c\n\x05\x04\x01\x02\x05\x03\x12\x030./\n\r\n\x05\x04\x01\ + \x02\x05\x08\x12\x04003.\n\x0f\n\x08\x04\x01\x02\x05\x08\xf2\xfb\x03\x12\ + \x031-G\n\x0f\n\x08\x04\x01\x02\x05\x08\xe9\xfb\x03\x12\x032-H\n\x0c\n\ + \x04\x04\x01\x02\x06\x12\x044\x029\x12\n\x0c\n\x05\x04\x01\x02\x06\x05\ + \x12\x034\x02\x08\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x034\t\x1d\n\x0c\n\ + \x05\x04\x01\x02\x06\x03\x12\x034\x20!\n\r\n\x05\x04\x01\x02\x06\x08\x12\ + \x044\"9\x11\n\x0f\n\x08\x04\x01\x02\x06\x08\xee\xfb\x03\x12\x035\x10H\n\ + \x0f\n\x08\x04\x01\x02\x06\x08\xeb\xfb\x03\x12\x036\x10\\\n\x0f\n\x08\ + \x04\x01\x02\x06\x08\xe9\xfb\x03\x12\x037\x10.\n\x0f\n\x08\x04\x01\x02\ + \x06\x08\xed\xfb\x03\x12\x038\x10 &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(4); + deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); + deps.push(super::trade_pair_id::file_descriptor().clone()); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::pair_id::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(2); + messages.push(LimitOrderTrancheKey::generated_message_descriptor_data()); + messages.push(LimitOrderTranche::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs b/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs new file mode 100644 index 00000000..e5b2070a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs @@ -0,0 +1,366 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/limit_order_tranche_user.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.LimitOrderTrancheUser) +pub struct LimitOrderTrancheUser { + // message fields + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.trade_pair_id) + pub trade_pair_id: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.tick_index_taker_to_maker) + pub tick_index_taker_to_maker: i64, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.tranche_key) + pub tranche_key: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.address) + pub address: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_owned) + pub shares_owned: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_withdrawn) + pub shares_withdrawn: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_cancelled) + pub shares_cancelled: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.order_type) + pub order_type: ::protobuf::EnumOrUnknown, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTrancheUser.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a LimitOrderTrancheUser { + fn default() -> &'a LimitOrderTrancheUser { + ::default_instance() + } +} + +impl LimitOrderTrancheUser { + pub fn new() -> LimitOrderTrancheUser { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(8); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( + "trade_pair_id", + |m: &LimitOrderTrancheUser| { &m.trade_pair_id }, + |m: &mut LimitOrderTrancheUser| { &mut m.trade_pair_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tick_index_taker_to_maker", + |m: &LimitOrderTrancheUser| { &m.tick_index_taker_to_maker }, + |m: &mut LimitOrderTrancheUser| { &mut m.tick_index_taker_to_maker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tranche_key", + |m: &LimitOrderTrancheUser| { &m.tranche_key }, + |m: &mut LimitOrderTrancheUser| { &mut m.tranche_key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "address", + |m: &LimitOrderTrancheUser| { &m.address }, + |m: &mut LimitOrderTrancheUser| { &mut m.address }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "shares_owned", + |m: &LimitOrderTrancheUser| { &m.shares_owned }, + |m: &mut LimitOrderTrancheUser| { &mut m.shares_owned }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "shares_withdrawn", + |m: &LimitOrderTrancheUser| { &m.shares_withdrawn }, + |m: &mut LimitOrderTrancheUser| { &mut m.shares_withdrawn }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "shares_cancelled", + |m: &LimitOrderTrancheUser| { &m.shares_cancelled }, + |m: &mut LimitOrderTrancheUser| { &mut m.shares_cancelled }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "order_type", + |m: &LimitOrderTrancheUser| { &m.order_type }, + |m: &mut LimitOrderTrancheUser| { &mut m.order_type }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "LimitOrderTrancheUser", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for LimitOrderTrancheUser { + const NAME: &'static str = "LimitOrderTrancheUser"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; + }, + 16 => { + self.tick_index_taker_to_maker = is.read_int64()?; + }, + 26 => { + self.tranche_key = is.read_string()?; + }, + 34 => { + self.address = is.read_string()?; + }, + 42 => { + self.shares_owned = is.read_string()?; + }, + 50 => { + self.shares_withdrawn = is.read_string()?; + }, + 58 => { + self.shares_cancelled = is.read_string()?; + }, + 64 => { + self.order_type = is.read_enum_or_unknown()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.trade_pair_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if self.tick_index_taker_to_maker != 0 { + my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); + } + if !self.tranche_key.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.tranche_key); + } + if !self.address.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.address); + } + if !self.shares_owned.is_empty() { + my_size += ::protobuf::rt::string_size(5, &self.shares_owned); + } + if !self.shares_withdrawn.is_empty() { + my_size += ::protobuf::rt::string_size(6, &self.shares_withdrawn); + } + if !self.shares_cancelled.is_empty() { + my_size += ::protobuf::rt::string_size(7, &self.shares_cancelled); + } + if self.order_type != ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED) { + my_size += ::protobuf::rt::int32_size(8, self.order_type.value()); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.trade_pair_id.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if self.tick_index_taker_to_maker != 0 { + os.write_int64(2, self.tick_index_taker_to_maker)?; + } + if !self.tranche_key.is_empty() { + os.write_string(3, &self.tranche_key)?; + } + if !self.address.is_empty() { + os.write_string(4, &self.address)?; + } + if !self.shares_owned.is_empty() { + os.write_string(5, &self.shares_owned)?; + } + if !self.shares_withdrawn.is_empty() { + os.write_string(6, &self.shares_withdrawn)?; + } + if !self.shares_cancelled.is_empty() { + os.write_string(7, &self.shares_cancelled)?; + } + if self.order_type != ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED) { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&self.order_type))?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> LimitOrderTrancheUser { + LimitOrderTrancheUser::new() + } + + fn clear(&mut self) { + self.trade_pair_id.clear(); + self.tick_index_taker_to_maker = 0; + self.tranche_key.clear(); + self.address.clear(); + self.shares_owned.clear(); + self.shares_withdrawn.clear(); + self.shares_cancelled.clear(); + self.order_type = ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED); + self.special_fields.clear(); + } + + fn default_instance() -> &'static LimitOrderTrancheUser { + static instance: LimitOrderTrancheUser = LimitOrderTrancheUser { + trade_pair_id: ::protobuf::MessageField::none(), + tick_index_taker_to_maker: 0, + tranche_key: ::std::string::String::new(), + address: ::std::string::String::new(), + shares_owned: ::std::string::String::new(), + shares_withdrawn: ::std::string::String::new(), + shares_cancelled: ::std::string::String::new(), + order_type: ::protobuf::EnumOrUnknown::from_i32(0), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for LimitOrderTrancheUser { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTrancheUser").unwrap()).clone() + } +} + +impl ::std::fmt::Display for LimitOrderTrancheUser { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LimitOrderTrancheUser { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n*neutron/dex/limit_order_tranche_user.proto\x12\x0bneutron.dex\x1a\x14\ + gogoproto/gogo.proto\x1a\x1fneutron/dex/trade_pair_id.proto\x1a\x14neutr\ + on/dex/tx.proto\"\x96\x05\n\x15LimitOrderTrancheUser\x12<\n\rtrade_pair_\ + id\x18\x01\x20\x01(\x0b2\x18.neutron.dex.TradePairIDR\x0btradePairId\x12\ + 8\n\x19tick_index_taker_to_maker\x18\x02\x20\x01(\x03R\x15tickIndexTaker\ + ToMaker\x12\x1f\n\x0btranche_key\x18\x03\x20\x01(\tR\ntrancheKey\x12\x18\ + \n\x07address\x18\x04\x20\x01(\tR\x07address\x12x\n\x0cshares_owned\x18\ + \x05\x20\x01(\tR\x0bsharesOwnedBU\xf2\xde\x1f\x13yaml:\"shares_owned\"\ + \xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ + \xde\x1f\x0cshares_owned\x12\x88\x01\n\x10shares_withdrawn\x18\x06\x20\ + \x01(\tR\x0fsharesWithdrawnB]\xf2\xde\x1f\x17yaml:\"shares_withdrawn\"\ + \xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ + \xde\x1f\x10shares_withdrawn\x12\x88\x01\n\x10shares_cancelled\x18\x07\ + \x20\x01(\tR\x0fsharesCancelledB]\xf2\xde\x1f\x17yaml:\"shares_cancelled\ + \"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ + \xde\x1f\x10shares_cancelled\x12:\n\norder_type\x18\x08\x20\x01(\x0e2\ + \x1b.neutron.dex.LimitOrderTypeR\torderTypeB,Z*github.com/neutron-org/ne\ + utron/x/dex/typesJ\x9e\x06\n\x06\x12\x04\0\0\x20\x01\n\x08\n\x01\x0c\x12\ + \x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\ + \x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x04\0\ + \x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\t\n\x02\x03\x02\x12\x03\x06\0\ + \x1e\n\n\n\x02\x04\0\x12\x04\x08\0\x20\x01\n\n\n\x03\x04\0\x01\x12\x03\ + \x08\x08\x1d\n\x0b\n\x04\x04\0\x02\0\x12\x03\t\x02\x20\n\x0c\n\x05\x04\0\ + \x02\0\x06\x12\x03\t\x02\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\t\x0e\x1b\ + \n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\t\x1e\x1f\n\x0b\n\x04\x04\0\x02\x01\ + \x12\x03\n\x02&\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\n\x02\x07\n\x0c\n\ + \x05\x04\0\x02\x01\x01\x12\x03\n\x08!\n\x0c\n\x05\x04\0\x02\x01\x03\x12\ + \x03\n$%\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x0b\x02\x19\n\x0c\n\x05\x04\0\ + \x02\x02\x05\x12\x03\x0b\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\ + \x0b\t\x14\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x0b\x17\x18\n\x0b\n\x04\ + \x04\0\x02\x03\x12\x03\x0c\x02\x15\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\ + \x0c\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x0c\t\x10\n\x0c\n\x05\ + \x04\0\x02\x03\x03\x12\x03\x0c\x13\x14\n\x0c\n\x04\x04\0\x02\x04\x12\x04\ + \r\x02\x12\x04\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\r\x02\x08\n\x0c\n\ + \x05\x04\0\x02\x04\x01\x12\x03\r\t\x15\n\x0c\n\x05\x04\0\x02\x04\x03\x12\ + \x03\r\x18\x19\n\r\n\x05\x04\0\x02\x04\x08\x12\x04\r\x1b\x12\x03\n\x0f\n\ + \x08\x04\0\x02\x04\x08\xee\xfb\x03\x12\x03\x0e\x066\n\x0f\n\x08\x04\0\ + \x02\x04\x08\xeb\xfb\x03\x12\x03\x0f\x06G\n\x0f\n\x08\x04\0\x02\x04\x08\ + \xe9\xfb\x03\x12\x03\x10\x06$\n\x0f\n\x08\x04\0\x02\x04\x08\xed\xfb\x03\ + \x12\x03\x11\x06*\n\x0c\n\x04\x04\0\x02\x05\x12\x04\x13\x02\x18\x04\n\ + \x0c\n\x05\x04\0\x02\x05\x05\x12\x03\x13\x02\x08\n\x0c\n\x05\x04\0\x02\ + \x05\x01\x12\x03\x13\t\x19\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x13\x1c\ + \x1d\n\r\n\x05\x04\0\x02\x05\x08\x12\x04\x13\x1f\x18\x03\n\x0f\n\x08\x04\ + \0\x02\x05\x08\xee\xfb\x03\x12\x03\x14\x06:\n\x0f\n\x08\x04\0\x02\x05\ + \x08\xeb\xfb\x03\x12\x03\x15\x06G\n\x0f\n\x08\x04\0\x02\x05\x08\xe9\xfb\ + \x03\x12\x03\x16\x06$\n\x0f\n\x08\x04\0\x02\x05\x08\xed\xfb\x03\x12\x03\ + \x17\x06.\n\x0c\n\x04\x04\0\x02\x06\x12\x04\x19\x02\x1e\x04\n\x0c\n\x05\ + \x04\0\x02\x06\x05\x12\x03\x19\x02\x08\n\x0c\n\x05\x04\0\x02\x06\x01\x12\ + \x03\x19\t\x19\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\x19\x1c\x1d\n\r\n\ + \x05\x04\0\x02\x06\x08\x12\x04\x19\x1f\x1e\x03\n\x0f\n\x08\x04\0\x02\x06\ + \x08\xee\xfb\x03\x12\x03\x1a\x06:\n\x0f\n\x08\x04\0\x02\x06\x08\xeb\xfb\ + \x03\x12\x03\x1b\x06G\n\x0f\n\x08\x04\0\x02\x06\x08\xe9\xfb\x03\x12\x03\ + \x1c\x06$\n\x0f\n\x08\x04\0\x02\x06\x08\xed\xfb\x03\x12\x03\x1d\x06.\n\ + \x0b\n\x04\x04\0\x02\x07\x12\x03\x1f\x02\x20\n\x0c\n\x05\x04\0\x02\x07\ + \x06\x12\x03\x1f\x02\x10\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x03\x1f\x11\ + \x1b\n\x0c\n\x05\x04\0\x02\x07\x03\x12\x03\x1f\x1e\x1fb\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(3); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::trade_pair_id::file_descriptor().clone()); + deps.push(super::tx::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(LimitOrderTrancheUser::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index 8574d1c1..2c4b54f8 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -1,3 +1,18 @@ // @generated +pub mod bank; +pub mod cosmos; +pub mod deposit_record; +pub mod gogo; +pub mod limit_order_expiration; +pub mod limit_order_tranche; +pub mod limit_order_tranche_user; +pub mod pair_id; +pub mod params; +pub mod pool; +pub mod pool_metadata; +pub mod pool_reserves; +pub mod tick_liquidity; +pub mod trade_pair_id; pub mod transfer; +pub mod tx; diff --git a/packages/neutron-sdk/src/proto_types/pair_id.rs b/packages/neutron-sdk/src/proto_types/pair_id.rs new file mode 100644 index 00000000..732f2745 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/pair_id.rs @@ -0,0 +1,210 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/pair_id.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.PairID) +pub struct PairID { + // message fields + // @@protoc_insertion_point(field:neutron.dex.PairID.token0) + pub token0: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.PairID.token1) + pub token1: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.PairID.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PairID { + fn default() -> &'a PairID { + ::default_instance() + } +} + +impl PairID { + pub fn new() -> PairID { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token0", + |m: &PairID| { &m.token0 }, + |m: &mut PairID| { &mut m.token0 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token1", + |m: &PairID| { &m.token1 }, + |m: &mut PairID| { &mut m.token1 }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PairID", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PairID { + const NAME: &'static str = "PairID"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.token0 = is.read_string()?; + }, + 18 => { + self.token1 = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.token0.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.token0); + } + if !self.token1.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.token1); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.token0.is_empty() { + os.write_string(1, &self.token0)?; + } + if !self.token1.is_empty() { + os.write_string(2, &self.token1)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> PairID { + PairID::new() + } + + fn clear(&mut self) { + self.token0.clear(); + self.token1.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static PairID { + static instance: PairID = PairID { + token0: ::std::string::String::new(), + token1: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PairID { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("PairID").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PairID { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PairID { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x19neutron/dex/pair_id.proto\x12\x0bneutron.dex\"8\n\x06PairID\x12\ + \x16\n\x06token0\x18\x01\x20\x01(\tR\x06token0\x12\x16\n\x06token1\x18\ + \x02\x20\x01(\tR\x06token1B,Z*github.com/neutron-org/neutron/x/dex/types\ + J\xb7\x01\n\x06\x12\x04\0\0\x08\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\ + \x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\ + \x02\x08\x0b\x12\x03\x03\0A\n\n\n\x02\x04\0\x12\x04\x05\0\x08\x01\n\n\n\ + \x03\x04\0\x01\x12\x03\x05\x08\x0e\n\x0b\n\x04\x04\0\x02\0\x12\x03\x06\ + \x02\x14\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x06\x02\x08\n\x0c\n\x05\x04\ + \0\x02\0\x01\x12\x03\x06\t\x0f\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x06\ + \x12\x13\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x07\x02\x14\n\x0c\n\x05\x04\0\ + \x02\x01\x05\x12\x03\x07\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\ + \x07\t\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x07\x12\x13b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(0); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(PairID::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/params.rs b/packages/neutron-sdk/src/proto_types/params.rs new file mode 100644 index 00000000..4ca58775 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/params.rs @@ -0,0 +1,198 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/params.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +/// Params defines the parameters for the module. +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.Params) +pub struct Params { + // message fields + // @@protoc_insertion_point(field:neutron.dex.Params.fee_tiers) + pub fee_tiers: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.Params.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Params { + fn default() -> &'a Params { + ::default_instance() + } +} + +impl Params { + pub fn new() -> Params { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "fee_tiers", + |m: &Params| { &m.fee_tiers }, + |m: &mut Params| { &mut m.fee_tiers }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Params", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Params { + const NAME: &'static str = "Params"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + is.read_repeated_packed_uint64_into(&mut self.fee_tiers)?; + }, + 8 => { + self.fee_tiers.push(is.read_uint64()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + for value in &self.fee_tiers { + my_size += ::protobuf::rt::uint64_size(1, *value); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + for v in &self.fee_tiers { + os.write_uint64(1, *v)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Params { + Params::new() + } + + fn clear(&mut self) { + self.fee_tiers.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Params { + static instance: Params = Params { + fee_tiers: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Params { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Params").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Params { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Params { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x18neutron/dex/params.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.\ + proto\"+\n\x06Params\x12\x1b\n\tfee_tiers\x18\x01\x20\x03(\x04R\x08feeTi\ + ers:\x04\x98\xa0\x1f\0B,Z*github.com/neutron-org/neutron/x/dex/typesJ\ + \xe5\x01\n\x06\x12\x04\0\0\x0b\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\ + \n\x01\x02\x12\x03\x01\0\x14\n\t\n\x02\x03\0\x12\x03\x03\0\x1e\n\x08\n\ + \x01\x08\x12\x03\x05\0A\n\t\n\x02\x08\x0b\x12\x03\x05\0A\n;\n\x02\x04\0\ + \x12\x04\x08\0\x0b\x01\x1a/\x20Params\x20defines\x20the\x20parameters\ + \x20for\x20the\x20module.\n\n\n\n\x03\x04\0\x01\x12\x03\x08\x08\x0e\n\n\ + \n\x03\x04\0\x07\x12\x03\t\x02.\n\r\n\x06\x04\0\x07\x83\xf4\x03\x12\x03\ + \t\x02.\n\x0b\n\x04\x04\0\x02\0\x12\x03\n\x02\x20\n\x0c\n\x05\x04\0\x02\ + \0\x04\x12\x03\n\x02\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\n\x0b\x11\n\ + \x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x12\x1b\n\x0c\n\x05\x04\0\x02\0\x03\ + \x12\x03\n\x1e\x1fb\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(1); + deps.push(super::gogo::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(Params::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/pool.rs b/packages/neutron-sdk/src/proto_types/pool.rs new file mode 100644 index 00000000..d095f1dc --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/pool.rs @@ -0,0 +1,241 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/pool.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.Pool) +pub struct Pool { + // message fields + // @@protoc_insertion_point(field:neutron.dex.Pool.id) + pub id: u64, + // @@protoc_insertion_point(field:neutron.dex.Pool.lower_tick0) + pub lower_tick0: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.Pool.upper_tick1) + pub upper_tick1: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.Pool.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a Pool { + fn default() -> &'a Pool { + ::default_instance() + } +} + +impl Pool { + pub fn new() -> Pool { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "id", + |m: &Pool| { &m.id }, + |m: &mut Pool| { &mut m.id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pool_reserves::PoolReserves>( + "lower_tick0", + |m: &Pool| { &m.lower_tick0 }, + |m: &mut Pool| { &mut m.lower_tick0 }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pool_reserves::PoolReserves>( + "upper_tick1", + |m: &Pool| { &m.upper_tick1 }, + |m: &mut Pool| { &mut m.upper_tick1 }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "Pool", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for Pool { + const NAME: &'static str = "Pool"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.id = is.read_uint64()?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.lower_tick0)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.upper_tick1)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.id != 0 { + my_size += ::protobuf::rt::uint64_size(1, self.id); + } + if let Some(v) = self.lower_tick0.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.upper_tick1.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.id != 0 { + os.write_uint64(1, self.id)?; + } + if let Some(v) = self.lower_tick0.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.upper_tick1.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> Pool { + Pool::new() + } + + fn clear(&mut self) { + self.id = 0; + self.lower_tick0.clear(); + self.upper_tick1.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static Pool { + static instance: Pool = Pool { + id: 0, + lower_tick0: ::protobuf::MessageField::none(), + upper_tick1: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for Pool { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("Pool").unwrap()).clone() + } +} + +impl ::std::fmt::Display for Pool { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Pool { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x16neutron/dex/pool.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.pr\ + oto\x1a\x1fneutron/dex/pool_reserves.proto\"\x8e\x01\n\x04Pool\x12\x0e\n\ + \x02id\x18\x01\x20\x01(\x04R\x02id\x12:\n\x0blower_tick0\x18\x02\x20\x01\ + (\x0b2\x19.neutron.dex.PoolReservesR\nlowerTick0\x12:\n\x0bupper_tick1\ + \x18\x03\x20\x01(\x0b2\x19.neutron.dex.PoolReservesR\nupperTick1B,Z*gith\ + ub.com/neutron-org/neutron/x/dex/typesJ\x8a\x03\n\x06\x12\x04\0\0\r\x01\ + \n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\ + \n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\ + \0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\x8f\x01\n\x02\ + \x04\0\x12\x04\t\0\r\x012\x82\x01\x20NOTE:\x20This\x20struct\x20is\x20ne\ + ver\x20actually\x20stored\x20in\x20the\x20KV\x20store.\x20It\x20is\x20me\ + rely\x20a\x20convenience\x20wrapper\x20for\x20holding\x20both\x20sides\ + \x20of\x20a\x20pool.\n\n\n\n\x03\x04\0\x01\x12\x03\t\x08\x0c\n\x0b\n\x04\ + \x04\0\x02\0\x12\x03\n\x04\x12\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\n\x04\ + \n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x0b\r\n\x0c\n\x05\x04\0\x02\0\ + \x03\x12\x03\n\x10\x11\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0b\x04!\n\x0c\ + \n\x05\x04\0\x02\x01\x06\x12\x03\x0b\x04\x10\n\x0c\n\x05\x04\0\x02\x01\ + \x01\x12\x03\x0b\x11\x1c\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0b\x1f\ + \x20\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x0c\x04!\n\x0c\n\x05\x04\0\x02\ + \x02\x06\x12\x03\x0c\x04\x10\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x0c\ + \x11\x1c\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x0c\x1f\x20b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(2); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::pool_reserves::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(Pool::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/pool_metadata.rs b/packages/neutron-sdk/src/proto_types/pool_metadata.rs new file mode 100644 index 00000000..d56fccf0 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/pool_metadata.rs @@ -0,0 +1,256 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/pool_metadata.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.PoolMetadata) +pub struct PoolMetadata { + // message fields + // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.id) + pub id: u64, + // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.tick) + pub tick: i64, + // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.fee) + pub fee: u64, + // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.pair_id) + pub pair_id: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.PoolMetadata.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PoolMetadata { + fn default() -> &'a PoolMetadata { + ::default_instance() + } +} + +impl PoolMetadata { + pub fn new() -> PoolMetadata { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(4); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "id", + |m: &PoolMetadata| { &m.id }, + |m: &mut PoolMetadata| { &mut m.id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tick", + |m: &PoolMetadata| { &m.tick }, + |m: &mut PoolMetadata| { &mut m.tick }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "fee", + |m: &PoolMetadata| { &m.fee }, + |m: &mut PoolMetadata| { &mut m.fee }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pair_id::PairID>( + "pair_id", + |m: &PoolMetadata| { &m.pair_id }, + |m: &mut PoolMetadata| { &mut m.pair_id }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PoolMetadata", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PoolMetadata { + const NAME: &'static str = "PoolMetadata"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.id = is.read_uint64()?; + }, + 16 => { + self.tick = is.read_int64()?; + }, + 24 => { + self.fee = is.read_uint64()?; + }, + 34 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.pair_id)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.id != 0 { + my_size += ::protobuf::rt::uint64_size(1, self.id); + } + if self.tick != 0 { + my_size += ::protobuf::rt::int64_size(2, self.tick); + } + if self.fee != 0 { + my_size += ::protobuf::rt::uint64_size(3, self.fee); + } + if let Some(v) = self.pair_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.id != 0 { + os.write_uint64(1, self.id)?; + } + if self.tick != 0 { + os.write_int64(2, self.tick)?; + } + if self.fee != 0 { + os.write_uint64(3, self.fee)?; + } + if let Some(v) = self.pair_id.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> PoolMetadata { + PoolMetadata::new() + } + + fn clear(&mut self) { + self.id = 0; + self.tick = 0; + self.fee = 0; + self.pair_id.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static PoolMetadata { + static instance: PoolMetadata = PoolMetadata { + id: 0, + tick: 0, + fee: 0, + pair_id: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PoolMetadata { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolMetadata").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PoolMetadata { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PoolMetadata { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1fneutron/dex/pool_metadata.proto\x12\x0bneutron.dex\x1a\x19neutron/\ + dex/pair_id.proto\"r\n\x0cPoolMetadata\x12\x0e\n\x02id\x18\x01\x20\x01(\ + \x04R\x02id\x12\x12\n\x04tick\x18\x02\x20\x01(\x03R\x04tick\x12\x10\n\ + \x03fee\x18\x03\x20\x01(\x04R\x03fee\x12,\n\x07pair_id\x18\x04\x20\x01(\ + \x0b2\x13.neutron.dex.PairIDR\x06pairIdB,Z*github.com/neutron-org/neutro\ + n/x/dex/typesJ\xb0\x02\n\x06\x12\x04\0\0\x0c\x01\n\x08\n\x01\x0c\x12\x03\ + \0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0\ + A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x05\0#\n\n\n\ + \x02\x04\0\x12\x04\x07\0\x0c\x01\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x14\ + \n\x0b\n\x04\x04\0\x02\0\x12\x03\x08\x02\x10\n\x0c\n\x05\x04\0\x02\0\x05\ + \x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\t\x0b\n\x0c\ + \n\x05\x04\0\x02\0\x03\x12\x03\x08\x0e\x0f\n\x0b\n\x04\x04\0\x02\x01\x12\ + \x03\t\x02\x11\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\t\x02\x07\n\x0c\n\ + \x05\x04\0\x02\x01\x01\x12\x03\t\x08\x0c\n\x0c\n\x05\x04\0\x02\x01\x03\ + \x12\x03\t\x0f\x10\n\x0b\n\x04\x04\0\x02\x02\x12\x03\n\x02\x11\n\x0c\n\ + \x05\x04\0\x02\x02\x05\x12\x03\n\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\ + \x12\x03\n\t\x0c\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\n\x0f\x10\n\x0b\n\ + \x04\x04\0\x02\x03\x12\x03\x0b\x02\x15\n\x0c\n\x05\x04\0\x02\x03\x06\x12\ + \x03\x0b\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x0b\t\x10\n\x0c\n\ + \x05\x04\0\x02\x03\x03\x12\x03\x0b\x13\x14b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(1); + deps.push(super::pair_id::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(PoolMetadata::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/pool_reserves.rs b/packages/neutron-sdk/src/proto_types/pool_reserves.rs new file mode 100644 index 00000000..a3b227f5 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/pool_reserves.rs @@ -0,0 +1,452 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/pool_reserves.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.PoolReservesKey) +pub struct PoolReservesKey { + // message fields + // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.trade_pair_id) + pub trade_pair_id: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.tick_index_taker_to_maker) + pub tick_index_taker_to_maker: i64, + // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.fee) + pub fee: u64, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.PoolReservesKey.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PoolReservesKey { + fn default() -> &'a PoolReservesKey { + ::default_instance() + } +} + +impl PoolReservesKey { + pub fn new() -> PoolReservesKey { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( + "trade_pair_id", + |m: &PoolReservesKey| { &m.trade_pair_id }, + |m: &mut PoolReservesKey| { &mut m.trade_pair_id }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tick_index_taker_to_maker", + |m: &PoolReservesKey| { &m.tick_index_taker_to_maker }, + |m: &mut PoolReservesKey| { &mut m.tick_index_taker_to_maker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "fee", + |m: &PoolReservesKey| { &m.fee }, + |m: &mut PoolReservesKey| { &mut m.fee }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PoolReservesKey", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PoolReservesKey { + const NAME: &'static str = "PoolReservesKey"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; + }, + 16 => { + self.tick_index_taker_to_maker = is.read_int64()?; + }, + 24 => { + self.fee = is.read_uint64()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.trade_pair_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if self.tick_index_taker_to_maker != 0 { + my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); + } + if self.fee != 0 { + my_size += ::protobuf::rt::uint64_size(3, self.fee); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.trade_pair_id.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if self.tick_index_taker_to_maker != 0 { + os.write_int64(2, self.tick_index_taker_to_maker)?; + } + if self.fee != 0 { + os.write_uint64(3, self.fee)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> PoolReservesKey { + PoolReservesKey::new() + } + + fn clear(&mut self) { + self.trade_pair_id.clear(); + self.tick_index_taker_to_maker = 0; + self.fee = 0; + self.special_fields.clear(); + } + + fn default_instance() -> &'static PoolReservesKey { + static instance: PoolReservesKey = PoolReservesKey { + trade_pair_id: ::protobuf::MessageField::none(), + tick_index_taker_to_maker: 0, + fee: 0, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PoolReservesKey { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolReservesKey").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PoolReservesKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PoolReservesKey { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.PoolReserves) +pub struct PoolReserves { + // message fields + // @@protoc_insertion_point(field:neutron.dex.PoolReserves.key) + pub key: ::protobuf::MessageField, + // @@protoc_insertion_point(field:neutron.dex.PoolReserves.reserves_maker_denom) + pub reserves_maker_denom: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.PoolReserves.price_taker_to_maker) + pub price_taker_to_maker: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.PoolReserves.price_opposite_taker_to_maker) + pub price_opposite_taker_to_maker: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.PoolReserves.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a PoolReserves { + fn default() -> &'a PoolReserves { + ::default_instance() + } +} + +impl PoolReserves { + pub fn new() -> PoolReserves { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(4); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PoolReservesKey>( + "key", + |m: &PoolReserves| { &m.key }, + |m: &mut PoolReserves| { &mut m.key }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "reserves_maker_denom", + |m: &PoolReserves| { &m.reserves_maker_denom }, + |m: &mut PoolReserves| { &mut m.reserves_maker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "price_taker_to_maker", + |m: &PoolReserves| { &m.price_taker_to_maker }, + |m: &mut PoolReserves| { &mut m.price_taker_to_maker }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "price_opposite_taker_to_maker", + |m: &PoolReserves| { &m.price_opposite_taker_to_maker }, + |m: &mut PoolReserves| { &mut m.price_opposite_taker_to_maker }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "PoolReserves", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for PoolReserves { + const NAME: &'static str = "PoolReserves"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.key)?; + }, + 18 => { + self.reserves_maker_denom = is.read_string()?; + }, + 26 => { + self.price_taker_to_maker = is.read_string()?; + }, + 34 => { + self.price_opposite_taker_to_maker = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.key.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.reserves_maker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.reserves_maker_denom); + } + if !self.price_taker_to_maker.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.price_taker_to_maker); + } + if !self.price_opposite_taker_to_maker.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.price_opposite_taker_to_maker); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.key.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + if !self.reserves_maker_denom.is_empty() { + os.write_string(2, &self.reserves_maker_denom)?; + } + if !self.price_taker_to_maker.is_empty() { + os.write_string(3, &self.price_taker_to_maker)?; + } + if !self.price_opposite_taker_to_maker.is_empty() { + os.write_string(4, &self.price_opposite_taker_to_maker)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> PoolReserves { + PoolReserves::new() + } + + fn clear(&mut self) { + self.key.clear(); + self.reserves_maker_denom.clear(); + self.price_taker_to_maker.clear(); + self.price_opposite_taker_to_maker.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static PoolReserves { + static instance: PoolReserves = PoolReserves { + key: ::protobuf::MessageField::none(), + reserves_maker_denom: ::std::string::String::new(), + price_taker_to_maker: ::std::string::String::new(), + price_opposite_taker_to_maker: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for PoolReserves { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolReserves").unwrap()).clone() + } +} + +impl ::std::fmt::Display for PoolReserves { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PoolReserves { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1fneutron/dex/pool_reserves.proto\x12\x0bneutron.dex\x1a\x14gogoprot\ + o/gogo.proto\x1a\x1fneutron/dex/trade_pair_id.proto\"\x9b\x01\n\x0fPoolR\ + eservesKey\x12<\n\rtrade_pair_id\x18\x01\x20\x01(\x0b2\x18.neutron.dex.T\ + radePairIDR\x0btradePairId\x128\n\x19tick_index_taker_to_maker\x18\x02\ + \x20\x01(\x03R\x15tickIndexTakerToMaker\x12\x10\n\x03fee\x18\x03\x20\x01\ + (\x04R\x03fee\"\xc4\x04\n\x0cPoolReserves\x12.\n\x03key\x18\x01\x20\x01(\ + \x0b2\x1c.neutron.dex.PoolReservesKeyR\x03key\x12\x97\x01\n\x14reserves_\ + maker_denom\x18\x02\x20\x01(\tR\x12reservesMakerDenomBe\xf2\xde\x1f\x1by\ + aml:\"reserves_maker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/ty\ + pes.Int\xea\xde\x1f\x14reserves_maker_denom\xc8\xde\x1f\0\x12\xa1\x01\n\ + \x14price_taker_to_maker\x18\x03\x20\x01(\tR\x11priceTakerToMakerBp\xf2\ + \xde\x1f\x1byaml:\"price_taker_to_maker\"\xda\xde\x1f1github.com/neutron\ + -org/neutron/utils/math.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x14price_taker\ + _to_maker\x12\xc5\x01\n\x1dprice_opposite_taker_to_maker\x18\x04\x20\x01\ + (\tR\x19priceOppositeTakerToMakerB\x82\x01\xf2\xde\x1f$yaml:\"price_oppo\ + site_taker_to_maker\"\xda\xde\x1f1github.com/neutron-org/neutron/utils/m\ + ath.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x1dprice_opposite_taker_to_makerB,\ + Z*github.com/neutron-org/neutron/x/dex/typesJ\xf4\x05\n\x06\x12\x04\0\0!\ + \x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\ + \x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\ + \x03\0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\n\n\x02\x04\ + \0\x12\x04\x07\0\x0b\x01\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x17\n\x0b\n\ + \x04\x04\0\x02\0\x12\x03\x08\x08&\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\ + \x08\x08\x13\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\x14!\n\x0c\n\x05\ + \x04\0\x02\0\x03\x12\x03\x08$%\n\x0b\n\x04\x04\0\x02\x01\x12\x03\t\x08,\ + \n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\t\x08\r\n\x0c\n\x05\x04\0\x02\x01\ + \x01\x12\x03\t\x0e'\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\t*+\n\x0b\n\ + \x04\x04\0\x02\x02\x12\x03\n\x08\x17\n\x0c\n\x05\x04\0\x02\x02\x05\x12\ + \x03\n\x08\x0e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\n\x0f\x12\n\x0c\n\ + \x05\x04\0\x02\x02\x03\x12\x03\n\x15\x16\n\n\n\x02\x04\x01\x12\x04\r\0!\ + \x01\n\n\n\x03\x04\x01\x01\x12\x03\r\x08\x14\n\x0b\n\x04\x04\x01\x02\0\ + \x12\x03\x0e\x02\x1a\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0e\x02\x11\n\ + \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x0e\x12\x15\n\x0c\n\x05\x04\x01\x02\ + \0\x03\x12\x03\x0e\x18\x19\n\x0c\n\x04\x04\x01\x02\x01\x12\x04\x0f\x02\ + \x14\x13\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x0f\x02\x08\n\x0c\n\x05\ + \x04\x01\x02\x01\x01\x12\x03\x0f\t\x1d\n\x0c\n\x05\x04\x01\x02\x01\x03\ + \x12\x03\x0f\x20!\n\r\n\x05\x04\x01\x02\x01\x08\x12\x04\x0f\"\x14\x12\n\ + \x0f\n\x08\x04\x01\x02\x01\x08\xee\xfb\x03\x12\x03\x10\x11I\n\x0f\n\x08\ + \x04\x01\x02\x01\x08\xeb\xfb\x03\x12\x03\x11\x11R\n\x0f\n\x08\x04\x01\ + \x02\x01\x08\xed\xfb\x03\x12\x03\x12\x11=\n\x0f\n\x08\x04\x01\x02\x01\ + \x08\xe9\xfb\x03\x12\x03\x13\x11/\n\x0c\n\x04\x04\x01\x02\x02\x12\x04\ + \x15\x02\x1a\x12\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x15\x02\x08\n\ + \x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x15\t\x1d\n\x0c\n\x05\x04\x01\x02\ + \x02\x03\x12\x03\x15\x20!\n\r\n\x05\x04\x01\x02\x02\x08\x12\x04\x15\"\ + \x1a\x11\n\x0f\n\x08\x04\x01\x02\x02\x08\xee\xfb\x03\x12\x03\x16\x10H\n\ + \x0f\n\x08\x04\x01\x02\x02\x08\xeb\xfb\x03\x12\x03\x17\x10\\\n\x0f\n\x08\ + \x04\x01\x02\x02\x08\xe9\xfb\x03\x12\x03\x18\x10.\n\x0f\n\x08\x04\x01\ + \x02\x02\x08\xed\xfb\x03\x12\x03\x19\x10<\n\x0c\n\x04\x04\x01\x02\x03\ + \x12\x04\x1b\x02\x20\x12\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x1b\x02\ + \x08\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x1b\t&\n\x0c\n\x05\x04\x01\ + \x02\x03\x03\x12\x03\x1b)*\n\r\n\x05\x04\x01\x02\x03\x08\x12\x04\x1b+\ + \x20\x11\n\x0f\n\x08\x04\x01\x02\x03\x08\xee\xfb\x03\x12\x03\x1c\x10Q\n\ + \x0f\n\x08\x04\x01\x02\x03\x08\xeb\xfb\x03\x12\x03\x1d\x10\\\n\x0f\n\x08\ + \x04\x01\x02\x03\x08\xe9\xfb\x03\x12\x03\x1e\x10.\n\x0f\n\x08\x04\x01\ + \x02\x03\x08\xed\xfb\x03\x12\x03\x1f\x10Eb\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(2); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::trade_pair_id::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(2); + messages.push(PoolReservesKey::generated_message_descriptor_data()); + messages.push(PoolReserves::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/tick_liquidity.rs b/packages/neutron-sdk/src/proto_types/tick_liquidity.rs new file mode 100644 index 00000000..00c98adf --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/tick_liquidity.rs @@ -0,0 +1,358 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/tick_liquidity.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.TickLiquidity) +pub struct TickLiquidity { + // message oneof groups + pub liquidity: ::std::option::Option, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.TickLiquidity.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TickLiquidity { + fn default() -> &'a TickLiquidity { + ::default_instance() + } +} + +impl TickLiquidity { + pub fn new() -> TickLiquidity { + ::std::default::Default::default() + } + + // .neutron.dex.PoolReserves pool_reserves = 1; + + pub fn pool_reserves(&self) -> &super::pool_reserves::PoolReserves { + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_pool_reserves(&mut self) { + self.liquidity = ::std::option::Option::None; + } + + pub fn has_pool_reserves(&self) -> bool { + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_pool_reserves(&mut self, v: super::pool_reserves::PoolReserves) { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(v)) + } + + // Mutable pointer to the field. + pub fn mut_pool_reserves(&mut self) -> &mut super::pool_reserves::PoolReserves { + if let ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(_)) = self.liquidity { + } else { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(super::pool_reserves::PoolReserves::new())); + } + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_pool_reserves(&mut self) -> super::pool_reserves::PoolReserves { + if self.has_pool_reserves() { + match self.liquidity.take() { + ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(v)) => v, + _ => panic!(), + } + } else { + super::pool_reserves::PoolReserves::new() + } + } + + // .neutron.dex.LimitOrderTranche limit_order_tranche = 2; + + pub fn limit_order_tranche(&self) -> &super::limit_order_tranche::LimitOrderTranche { + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(ref v)) => v, + _ => ::default_instance(), + } + } + + pub fn clear_limit_order_tranche(&mut self) { + self.liquidity = ::std::option::Option::None; + } + + pub fn has_limit_order_tranche(&self) -> bool { + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_limit_order_tranche(&mut self, v: super::limit_order_tranche::LimitOrderTranche) { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(v)) + } + + // Mutable pointer to the field. + pub fn mut_limit_order_tranche(&mut self) -> &mut super::limit_order_tranche::LimitOrderTranche { + if let ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(_)) = self.liquidity { + } else { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(super::limit_order_tranche::LimitOrderTranche::new())); + } + match self.liquidity { + ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_limit_order_tranche(&mut self) -> super::limit_order_tranche::LimitOrderTranche { + if self.has_limit_order_tranche() { + match self.liquidity.take() { + ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(v)) => v, + _ => panic!(), + } + } else { + super::limit_order_tranche::LimitOrderTranche::new() + } + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(1); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::pool_reserves::PoolReserves>( + "pool_reserves", + TickLiquidity::has_pool_reserves, + TickLiquidity::pool_reserves, + TickLiquidity::mut_pool_reserves, + TickLiquidity::set_pool_reserves, + )); + fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::limit_order_tranche::LimitOrderTranche>( + "limit_order_tranche", + TickLiquidity::has_limit_order_tranche, + TickLiquidity::limit_order_tranche, + TickLiquidity::mut_limit_order_tranche, + TickLiquidity::set_limit_order_tranche, + )); + oneofs.push(tick_liquidity::Liquidity::generated_oneof_descriptor_data()); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TickLiquidity", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TickLiquidity { + const NAME: &'static str = "TickLiquidity"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(is.read_message()?)); + }, + 18 => { + self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(is.read_message()?)); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let ::std::option::Option::Some(ref v) = self.liquidity { + match v { + &tick_liquidity::Liquidity::PoolReserves(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + &tick_liquidity::Liquidity::LimitOrderTranche(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let ::std::option::Option::Some(ref v) = self.liquidity { + match v { + &tick_liquidity::Liquidity::PoolReserves(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + }, + &tick_liquidity::Liquidity::LimitOrderTranche(ref v) => { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + }, + }; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> TickLiquidity { + TickLiquidity::new() + } + + fn clear(&mut self) { + self.liquidity = ::std::option::Option::None; + self.liquidity = ::std::option::Option::None; + self.special_fields.clear(); + } + + fn default_instance() -> &'static TickLiquidity { + static instance: TickLiquidity = TickLiquidity { + liquidity: ::std::option::Option::None, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TickLiquidity { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("TickLiquidity").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TickLiquidity { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TickLiquidity { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// Nested message and enums of message `TickLiquidity` +pub mod tick_liquidity { + + #[derive(Clone,PartialEq,Debug)] + #[non_exhaustive] + // @@protoc_insertion_point(oneof:neutron.dex.TickLiquidity.liquidity) + pub enum Liquidity { + // @@protoc_insertion_point(oneof_field:neutron.dex.TickLiquidity.pool_reserves) + PoolReserves(super::super::pool_reserves::PoolReserves), + // @@protoc_insertion_point(oneof_field:neutron.dex.TickLiquidity.limit_order_tranche) + LimitOrderTranche(super::super::limit_order_tranche::LimitOrderTranche), + } + + impl ::protobuf::Oneof for Liquidity { + } + + impl ::protobuf::OneofFull for Liquidity { + fn descriptor() -> ::protobuf::reflect::OneofDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| ::descriptor().oneof_by_name("liquidity").unwrap()).clone() + } + } + + impl Liquidity { + pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { + ::protobuf::reflect::GeneratedOneofDescriptorData::new::("liquidity") + } + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x20neutron/dex/tick_liquidity.proto\x12\x0bneutron.dex\x1a\x14gogopro\ + to/gogo.proto\x1a%neutron/dex/limit_order_tranche.proto\x1a\x1fneutron/d\ + ex/pool_reserves.proto\"\xb0\x01\n\rTickLiquidity\x12@\n\rpool_reserves\ + \x18\x01\x20\x01(\x0b2\x19.neutron.dex.PoolReservesH\0R\x0cpoolReserves\ + \x12P\n\x13limit_order_tranche\x18\x02\x20\x01(\x0b2\x1e.neutron.dex.Lim\ + itOrderTrancheH\0R\x11limitOrderTrancheB\x0b\n\tliquidityB,Z*github.com/\ + neutron-org/neutron/x/dex/typesJ\xf4\x01\n\x06\x12\x04\0\0\x0f\x01\n\x08\ + \n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\ + \x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\ + \x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0/\n\t\n\x02\x03\x02\x12\ + \x03\x06\0)\n\n\n\x02\x04\0\x12\x04\t\0\x0f\x01\n\n\n\x03\x04\0\x01\x12\ + \x03\t\x08\x15\n\x0c\n\x04\x04\0\x08\0\x12\x04\n\x02\r\x03\n\x0c\n\x05\ + \x04\0\x08\0\x01\x12\x03\n\x08\x11\n\x0b\n\x04\x04\0\x02\0\x12\x03\x0b\ + \x04#\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0b\x04\x10\n\x0c\n\x05\x04\0\ + \x02\0\x01\x12\x03\x0b\x11\x1e\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x0b!\ + \"\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0c\x04.\n\x0c\n\x05\x04\0\x02\x01\ + \x06\x12\x03\x0c\x04\x15\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x0c\x16)\ + \n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0c,-b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(3); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::limit_order_tranche::file_descriptor().clone()); + deps.push(super::pool_reserves::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(TickLiquidity::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/trade_pair_id.rs b/packages/neutron-sdk/src/proto_types/trade_pair_id.rs new file mode 100644 index 00000000..efb68b7a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/trade_pair_id.rs @@ -0,0 +1,211 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/trade_pair_id.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.TradePairID) +pub struct TradePairID { + // message fields + // @@protoc_insertion_point(field:neutron.dex.TradePairID.maker_denom) + pub maker_denom: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.TradePairID.taker_denom) + pub taker_denom: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.TradePairID.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a TradePairID { + fn default() -> &'a TradePairID { + ::default_instance() + } +} + +impl TradePairID { + pub fn new() -> TradePairID { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "maker_denom", + |m: &TradePairID| { &m.maker_denom }, + |m: &mut TradePairID| { &mut m.maker_denom }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "taker_denom", + |m: &TradePairID| { &m.taker_denom }, + |m: &mut TradePairID| { &mut m.taker_denom }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "TradePairID", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for TradePairID { + const NAME: &'static str = "TradePairID"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 18 => { + self.maker_denom = is.read_string()?; + }, + 26 => { + self.taker_denom = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.maker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.maker_denom); + } + if !self.taker_denom.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.taker_denom); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.maker_denom.is_empty() { + os.write_string(2, &self.maker_denom)?; + } + if !self.taker_denom.is_empty() { + os.write_string(3, &self.taker_denom)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> TradePairID { + TradePairID::new() + } + + fn clear(&mut self) { + self.maker_denom.clear(); + self.taker_denom.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static TradePairID { + static instance: TradePairID = TradePairID { + maker_denom: ::std::string::String::new(), + taker_denom: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for TradePairID { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("TradePairID").unwrap()).clone() + } +} + +impl ::std::fmt::Display for TradePairID { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TradePairID { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1fneutron/dex/trade_pair_id.proto\x12\x0bneutron.dex\"O\n\x0bTradePa\ + irID\x12\x1f\n\x0bmaker_denom\x18\x02\x20\x01(\tR\nmakerDenom\x12\x1f\n\ + \x0btaker_denom\x18\x03\x20\x01(\tR\ntakerDenomB,Z*github.com/neutron-or\ + g/neutron/x/dex/typesJ\xb7\x01\n\x06\x12\x04\0\0\x08\x01\n\x08\n\x01\x0c\ + \x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\ + \x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\n\n\x02\x04\0\x12\x04\x05\ + \0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\x05\x08\x13\n\x0b\n\x04\x04\0\x02\ + \0\x12\x03\x06\x04\x1b\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x06\x04\n\n\ + \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x06\x0b\x16\n\x0c\n\x05\x04\0\x02\0\ + \x03\x12\x03\x06\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x07\x04\x1b\n\ + \x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\0\x02\x01\ + \x01\x12\x03\x07\x0b\x16\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x07\x19\ + \x1ab\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(0); + let mut messages = ::std::vec::Vec::with_capacity(1); + messages.push(TradePairID::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/packages/neutron-sdk/src/proto_types/transfer.rs b/packages/neutron-sdk/src/proto_types/transfer.rs index 09c1d2b4..4a8bd5d0 100644 --- a/packages/neutron-sdk/src/proto_types/transfer.rs +++ b/packages/neutron-sdk/src/proto_types/transfer.rs @@ -34,7 +34,7 @@ pub struct MsgTransferResponse { /// channel's sequence_id for outgoing ibc packet. Unique per a channel. // @@protoc_insertion_point(field:neutron.transfer.MsgTransferResponse.sequence_id) pub sequence_id: u64, - /// channel src channel on neutron side trasaction was submitted from + /// channel src channel on neutron side transaction was submitted from // @@protoc_insertion_point(field:neutron.transfer.MsgTransferResponse.channel) pub channel: ::std::string::String, // special fields @@ -172,7 +172,7 @@ impl ::protobuf::reflect::ProtobufValue for MsgTransferResponse { static file_descriptor_proto_data: &'static [u8] = b"\ \n\x1atransfer/v1/transfer.proto\x12\x10neutron.transfer\"P\n\x13MsgTran\ sferResponse\x12\x1f\n\x0bsequence_id\x18\x01\x20\x01(\x04R\nsequenceId\ - \x12\x18\n\x07channel\x18\x02\x20\x01(\tR\x07channelJ\xfd\x02\n\x06\x12\ + \x12\x18\n\x07channel\x18\x02\x20\x01(\tR\x07channelJ\xfe\x02\n\x06\x12\ \x04\0\0\x0b\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\ \x02\0\x19\nX\n\x02\x04\0\x12\x04\x06\0\x0b\x01\x1aL\x20MsgTransferRespo\ nse\x20is\x20the\x20modified\x20response\x20type\x20for\n\x20ibc-go\x20M\ @@ -180,9 +180,9 @@ static file_descriptor_proto_data: &'static [u8] = b"\ \0\x12\x03\x08\x02\x19\x1aF\x20channel's\x20sequence_id\x20for\x20outgoi\ ng\x20ibc\x20packet.\x20Unique\x20per\x20a\x20channel.\n\n\x0c\n\x05\x04\ \0\x02\0\x05\x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\ - \t\x14\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x17\x18\nP\n\x04\x04\0\ - \x02\x01\x12\x03\n\x02\x15\x1aC\x20channel\x20src\x20channel\x20on\x20ne\ - utron\x20side\x20trasaction\x20was\x20submitted\x20from\n\n\x0c\n\x05\ + \t\x14\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x17\x18\nQ\n\x04\x04\0\ + \x02\x01\x12\x03\n\x02\x15\x1aD\x20channel\x20src\x20channel\x20on\x20ne\ + utron\x20side\x20transaction\x20was\x20submitted\x20from\n\n\x0c\n\x05\ \x04\0\x02\x01\x05\x12\x03\n\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\ \x03\n\t\x10\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\n\x13\x14b\x06proto3\ "; diff --git a/packages/neutron-sdk/src/proto_types/tx.rs b/packages/neutron-sdk/src/proto_types/tx.rs new file mode 100644 index 00000000..1c21441d --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/tx.rs @@ -0,0 +1,3002 @@ +// This file is generated by rust-protobuf 3.2.0. Do not edit +// .proto file is parsed by protoc --rust-out=... +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_results)] +#![allow(unused_mut)] + +//! Generated file from `neutron/dex/tx.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.DepositOptions) +pub struct DepositOptions { + // message fields + // @@protoc_insertion_point(field:neutron.dex.DepositOptions.disable_autoswap) + pub disable_autoswap: bool, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.DepositOptions.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a DepositOptions { + fn default() -> &'a DepositOptions { + ::default_instance() + } +} + +impl DepositOptions { + pub fn new() -> DepositOptions { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "disable_autoswap", + |m: &DepositOptions| { &m.disable_autoswap }, + |m: &mut DepositOptions| { &mut m.disable_autoswap }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "DepositOptions", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for DepositOptions { + const NAME: &'static str = "DepositOptions"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 8 => { + self.disable_autoswap = is.read_bool()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if self.disable_autoswap != false { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if self.disable_autoswap != false { + os.write_bool(1, self.disable_autoswap)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> DepositOptions { + DepositOptions::new() + } + + fn clear(&mut self) { + self.disable_autoswap = false; + self.special_fields.clear(); + } + + fn default_instance() -> &'static DepositOptions { + static instance: DepositOptions = DepositOptions { + disable_autoswap: false, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for DepositOptions { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("DepositOptions").unwrap()).clone() + } +} + +impl ::std::fmt::Display for DepositOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DepositOptions { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgDeposit) +pub struct MsgDeposit { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.receiver) + pub receiver: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.token_a) + pub token_a: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.token_b) + pub token_b: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.amounts_a) + pub amounts_a: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.amounts_b) + pub amounts_b: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.tick_indexes_a_to_b) + pub tick_indexes_a_to_b: ::std::vec::Vec, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.fees) + pub fees: ::std::vec::Vec, + // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.options) + pub options: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgDeposit.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgDeposit { + fn default() -> &'a MsgDeposit { + ::default_instance() + } +} + +impl MsgDeposit { + pub fn new() -> MsgDeposit { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgDeposit| { &m.creator }, + |m: &mut MsgDeposit| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "receiver", + |m: &MsgDeposit| { &m.receiver }, + |m: &mut MsgDeposit| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_a", + |m: &MsgDeposit| { &m.token_a }, + |m: &mut MsgDeposit| { &mut m.token_a }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_b", + |m: &MsgDeposit| { &m.token_b }, + |m: &mut MsgDeposit| { &mut m.token_b }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "amounts_a", + |m: &MsgDeposit| { &m.amounts_a }, + |m: &mut MsgDeposit| { &mut m.amounts_a }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "amounts_b", + |m: &MsgDeposit| { &m.amounts_b }, + |m: &mut MsgDeposit| { &mut m.amounts_b }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "tick_indexes_a_to_b", + |m: &MsgDeposit| { &m.tick_indexes_a_to_b }, + |m: &mut MsgDeposit| { &mut m.tick_indexes_a_to_b }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "fees", + |m: &MsgDeposit| { &m.fees }, + |m: &mut MsgDeposit| { &mut m.fees }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "options", + |m: &MsgDeposit| { &m.options }, + |m: &mut MsgDeposit| { &mut m.options }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgDeposit", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgDeposit { + const NAME: &'static str = "MsgDeposit"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.receiver = is.read_string()?; + }, + 26 => { + self.token_a = is.read_string()?; + }, + 34 => { + self.token_b = is.read_string()?; + }, + 42 => { + self.amounts_a.push(is.read_string()?); + }, + 50 => { + self.amounts_b.push(is.read_string()?); + }, + 58 => { + is.read_repeated_packed_int64_into(&mut self.tick_indexes_a_to_b)?; + }, + 56 => { + self.tick_indexes_a_to_b.push(is.read_int64()?); + }, + 66 => { + is.read_repeated_packed_uint64_into(&mut self.fees)?; + }, + 64 => { + self.fees.push(is.read_uint64()?); + }, + 74 => { + self.options.push(is.read_message()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.receiver.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.receiver); + } + if !self.token_a.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.token_a); + } + if !self.token_b.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.token_b); + } + for value in &self.amounts_a { + my_size += ::protobuf::rt::string_size(5, &value); + }; + for value in &self.amounts_b { + my_size += ::protobuf::rt::string_size(6, &value); + }; + for value in &self.tick_indexes_a_to_b { + my_size += ::protobuf::rt::int64_size(7, *value); + }; + for value in &self.fees { + my_size += ::protobuf::rt::uint64_size(8, *value); + }; + for value in &self.options { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.receiver.is_empty() { + os.write_string(2, &self.receiver)?; + } + if !self.token_a.is_empty() { + os.write_string(3, &self.token_a)?; + } + if !self.token_b.is_empty() { + os.write_string(4, &self.token_b)?; + } + for v in &self.amounts_a { + os.write_string(5, &v)?; + }; + for v in &self.amounts_b { + os.write_string(6, &v)?; + }; + for v in &self.tick_indexes_a_to_b { + os.write_int64(7, *v)?; + }; + for v in &self.fees { + os.write_uint64(8, *v)?; + }; + for v in &self.options { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgDeposit { + MsgDeposit::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.receiver.clear(); + self.token_a.clear(); + self.token_b.clear(); + self.amounts_a.clear(); + self.amounts_b.clear(); + self.tick_indexes_a_to_b.clear(); + self.fees.clear(); + self.options.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgDeposit { + static instance: MsgDeposit = MsgDeposit { + creator: ::std::string::String::new(), + receiver: ::std::string::String::new(), + token_a: ::std::string::String::new(), + token_b: ::std::string::String::new(), + amounts_a: ::std::vec::Vec::new(), + amounts_b: ::std::vec::Vec::new(), + tick_indexes_a_to_b: ::std::vec::Vec::new(), + fees: ::std::vec::Vec::new(), + options: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgDeposit { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgDeposit").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgDeposit { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgDeposit { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgDepositResponse) +pub struct MsgDepositResponse { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgDepositResponse.reserve0_deposited) + pub reserve0_deposited: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:neutron.dex.MsgDepositResponse.reserve1_deposited) + pub reserve1_deposited: ::std::vec::Vec<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgDepositResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgDepositResponse { + fn default() -> &'a MsgDepositResponse { + ::default_instance() + } +} + +impl MsgDepositResponse { + pub fn new() -> MsgDepositResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "reserve0_deposited", + |m: &MsgDepositResponse| { &m.reserve0_deposited }, + |m: &mut MsgDepositResponse| { &mut m.reserve0_deposited }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "reserve1_deposited", + |m: &MsgDepositResponse| { &m.reserve1_deposited }, + |m: &mut MsgDepositResponse| { &mut m.reserve1_deposited }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgDepositResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgDepositResponse { + const NAME: &'static str = "MsgDepositResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.reserve0_deposited.push(is.read_string()?); + }, + 18 => { + self.reserve1_deposited.push(is.read_string()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + for value in &self.reserve0_deposited { + my_size += ::protobuf::rt::string_size(1, &value); + }; + for value in &self.reserve1_deposited { + my_size += ::protobuf::rt::string_size(2, &value); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + for v in &self.reserve0_deposited { + os.write_string(1, &v)?; + }; + for v in &self.reserve1_deposited { + os.write_string(2, &v)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgDepositResponse { + MsgDepositResponse::new() + } + + fn clear(&mut self) { + self.reserve0_deposited.clear(); + self.reserve1_deposited.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgDepositResponse { + static instance: MsgDepositResponse = MsgDepositResponse { + reserve0_deposited: ::std::vec::Vec::new(), + reserve1_deposited: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgDepositResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgDepositResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgDepositResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgDepositResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawal) +pub struct MsgWithdrawal { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.receiver) + pub receiver: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.token_a) + pub token_a: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.token_b) + pub token_b: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.shares_to_remove) + pub shares_to_remove: ::std::vec::Vec<::std::string::String>, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.tick_indexes_a_to_b) + pub tick_indexes_a_to_b: ::std::vec::Vec, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.fees) + pub fees: ::std::vec::Vec, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawal.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgWithdrawal { + fn default() -> &'a MsgWithdrawal { + ::default_instance() + } +} + +impl MsgWithdrawal { + pub fn new() -> MsgWithdrawal { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(7); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgWithdrawal| { &m.creator }, + |m: &mut MsgWithdrawal| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "receiver", + |m: &MsgWithdrawal| { &m.receiver }, + |m: &mut MsgWithdrawal| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_a", + |m: &MsgWithdrawal| { &m.token_a }, + |m: &mut MsgWithdrawal| { &mut m.token_a }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_b", + |m: &MsgWithdrawal| { &m.token_b }, + |m: &mut MsgWithdrawal| { &mut m.token_b }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "shares_to_remove", + |m: &MsgWithdrawal| { &m.shares_to_remove }, + |m: &mut MsgWithdrawal| { &mut m.shares_to_remove }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "tick_indexes_a_to_b", + |m: &MsgWithdrawal| { &m.tick_indexes_a_to_b }, + |m: &mut MsgWithdrawal| { &mut m.tick_indexes_a_to_b }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "fees", + |m: &MsgWithdrawal| { &m.fees }, + |m: &mut MsgWithdrawal| { &mut m.fees }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgWithdrawal", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgWithdrawal { + const NAME: &'static str = "MsgWithdrawal"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.receiver = is.read_string()?; + }, + 26 => { + self.token_a = is.read_string()?; + }, + 34 => { + self.token_b = is.read_string()?; + }, + 42 => { + self.shares_to_remove.push(is.read_string()?); + }, + 50 => { + is.read_repeated_packed_int64_into(&mut self.tick_indexes_a_to_b)?; + }, + 48 => { + self.tick_indexes_a_to_b.push(is.read_int64()?); + }, + 58 => { + is.read_repeated_packed_uint64_into(&mut self.fees)?; + }, + 56 => { + self.fees.push(is.read_uint64()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.receiver.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.receiver); + } + if !self.token_a.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.token_a); + } + if !self.token_b.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.token_b); + } + for value in &self.shares_to_remove { + my_size += ::protobuf::rt::string_size(5, &value); + }; + for value in &self.tick_indexes_a_to_b { + my_size += ::protobuf::rt::int64_size(6, *value); + }; + for value in &self.fees { + my_size += ::protobuf::rt::uint64_size(7, *value); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.receiver.is_empty() { + os.write_string(2, &self.receiver)?; + } + if !self.token_a.is_empty() { + os.write_string(3, &self.token_a)?; + } + if !self.token_b.is_empty() { + os.write_string(4, &self.token_b)?; + } + for v in &self.shares_to_remove { + os.write_string(5, &v)?; + }; + for v in &self.tick_indexes_a_to_b { + os.write_int64(6, *v)?; + }; + for v in &self.fees { + os.write_uint64(7, *v)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgWithdrawal { + MsgWithdrawal::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.receiver.clear(); + self.token_a.clear(); + self.token_b.clear(); + self.shares_to_remove.clear(); + self.tick_indexes_a_to_b.clear(); + self.fees.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgWithdrawal { + static instance: MsgWithdrawal = MsgWithdrawal { + creator: ::std::string::String::new(), + receiver: ::std::string::String::new(), + token_a: ::std::string::String::new(), + token_b: ::std::string::String::new(), + shares_to_remove: ::std::vec::Vec::new(), + tick_indexes_a_to_b: ::std::vec::Vec::new(), + fees: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgWithdrawal { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawal").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgWithdrawal { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgWithdrawal { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawalResponse) +pub struct MsgWithdrawalResponse { + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawalResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgWithdrawalResponse { + fn default() -> &'a MsgWithdrawalResponse { + ::default_instance() + } +} + +impl MsgWithdrawalResponse { + pub fn new() -> MsgWithdrawalResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgWithdrawalResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgWithdrawalResponse { + const NAME: &'static str = "MsgWithdrawalResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgWithdrawalResponse { + MsgWithdrawalResponse::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgWithdrawalResponse { + static instance: MsgWithdrawalResponse = MsgWithdrawalResponse { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgWithdrawalResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawalResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgWithdrawalResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgWithdrawalResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgPlaceLimitOrder) +pub struct MsgPlaceLimitOrder { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.receiver) + pub receiver: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.token_in) + pub token_in: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.token_out) + pub token_out: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.tick_index_in_to_out) + pub tick_index_in_to_out: i64, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.amount_in) + pub amount_in: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.order_type) + pub order_type: ::protobuf::EnumOrUnknown, + /// expirationTime is only valid iff orderType == GOOD_TIL_TIME. + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.expiration_time) + pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.max_amount_out) + pub max_amount_out: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgPlaceLimitOrder.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgPlaceLimitOrder { + fn default() -> &'a MsgPlaceLimitOrder { + ::default_instance() + } +} + +impl MsgPlaceLimitOrder { + pub fn new() -> MsgPlaceLimitOrder { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(9); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgPlaceLimitOrder| { &m.creator }, + |m: &mut MsgPlaceLimitOrder| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "receiver", + |m: &MsgPlaceLimitOrder| { &m.receiver }, + |m: &mut MsgPlaceLimitOrder| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_in", + |m: &MsgPlaceLimitOrder| { &m.token_in }, + |m: &mut MsgPlaceLimitOrder| { &mut m.token_in }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "token_out", + |m: &MsgPlaceLimitOrder| { &m.token_out }, + |m: &mut MsgPlaceLimitOrder| { &mut m.token_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tick_index_in_to_out", + |m: &MsgPlaceLimitOrder| { &m.tick_index_in_to_out }, + |m: &mut MsgPlaceLimitOrder| { &mut m.tick_index_in_to_out }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "amount_in", + |m: &MsgPlaceLimitOrder| { &m.amount_in }, + |m: &mut MsgPlaceLimitOrder| { &mut m.amount_in }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "order_type", + |m: &MsgPlaceLimitOrder| { &m.order_type }, + |m: &mut MsgPlaceLimitOrder| { &mut m.order_type }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( + "expiration_time", + |m: &MsgPlaceLimitOrder| { &m.expiration_time }, + |m: &mut MsgPlaceLimitOrder| { &mut m.expiration_time }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "max_amount_out", + |m: &MsgPlaceLimitOrder| { &m.max_amount_out }, + |m: &mut MsgPlaceLimitOrder| { &mut m.max_amount_out }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgPlaceLimitOrder", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgPlaceLimitOrder { + const NAME: &'static str = "MsgPlaceLimitOrder"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.receiver = is.read_string()?; + }, + 26 => { + self.token_in = is.read_string()?; + }, + 34 => { + self.token_out = is.read_string()?; + }, + 40 => { + self.tick_index_in_to_out = is.read_int64()?; + }, + 58 => { + self.amount_in = is.read_string()?; + }, + 64 => { + self.order_type = is.read_enum_or_unknown()?; + }, + 74 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; + }, + 82 => { + self.max_amount_out = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.receiver.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.receiver); + } + if !self.token_in.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.token_in); + } + if !self.token_out.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.token_out); + } + if self.tick_index_in_to_out != 0 { + my_size += ::protobuf::rt::int64_size(5, self.tick_index_in_to_out); + } + if !self.amount_in.is_empty() { + my_size += ::protobuf::rt::string_size(7, &self.amount_in); + } + if self.order_type != ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED) { + my_size += ::protobuf::rt::int32_size(8, self.order_type.value()); + } + if let Some(v) = self.expiration_time.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if !self.max_amount_out.is_empty() { + my_size += ::protobuf::rt::string_size(10, &self.max_amount_out); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.receiver.is_empty() { + os.write_string(2, &self.receiver)?; + } + if !self.token_in.is_empty() { + os.write_string(3, &self.token_in)?; + } + if !self.token_out.is_empty() { + os.write_string(4, &self.token_out)?; + } + if self.tick_index_in_to_out != 0 { + os.write_int64(5, self.tick_index_in_to_out)?; + } + if !self.amount_in.is_empty() { + os.write_string(7, &self.amount_in)?; + } + if self.order_type != ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED) { + os.write_enum(8, ::protobuf::EnumOrUnknown::value(&self.order_type))?; + } + if let Some(v) = self.expiration_time.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; + } + if !self.max_amount_out.is_empty() { + os.write_string(10, &self.max_amount_out)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgPlaceLimitOrder { + MsgPlaceLimitOrder::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.receiver.clear(); + self.token_in.clear(); + self.token_out.clear(); + self.tick_index_in_to_out = 0; + self.amount_in.clear(); + self.order_type = ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED); + self.expiration_time.clear(); + self.max_amount_out.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgPlaceLimitOrder { + static instance: MsgPlaceLimitOrder = MsgPlaceLimitOrder { + creator: ::std::string::String::new(), + receiver: ::std::string::String::new(), + token_in: ::std::string::String::new(), + token_out: ::std::string::String::new(), + tick_index_in_to_out: 0, + amount_in: ::std::string::String::new(), + order_type: ::protobuf::EnumOrUnknown::from_i32(0), + expiration_time: ::protobuf::MessageField::none(), + max_amount_out: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgPlaceLimitOrder { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgPlaceLimitOrder").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgPlaceLimitOrder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgPlaceLimitOrder { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgPlaceLimitOrderResponse) +pub struct MsgPlaceLimitOrderResponse { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.trancheKey) + pub trancheKey: ::std::string::String, + /// Total amount of coin used for the limit order + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.coin_in) + pub coin_in: ::protobuf::MessageField, + /// Total amount of coin received from the taker portion of the limit order + /// This is the amount of coin immediately available in the users account after executing the + /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.taker_coin_out) + pub taker_coin_out: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgPlaceLimitOrderResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgPlaceLimitOrderResponse { + fn default() -> &'a MsgPlaceLimitOrderResponse { + ::default_instance() + } +} + +impl MsgPlaceLimitOrderResponse { + pub fn new() -> MsgPlaceLimitOrderResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(3); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "trancheKey", + |m: &MsgPlaceLimitOrderResponse| { &m.trancheKey }, + |m: &mut MsgPlaceLimitOrderResponse| { &mut m.trancheKey }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( + "coin_in", + |m: &MsgPlaceLimitOrderResponse| { &m.coin_in }, + |m: &mut MsgPlaceLimitOrderResponse| { &mut m.coin_in }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( + "taker_coin_out", + |m: &MsgPlaceLimitOrderResponse| { &m.taker_coin_out }, + |m: &mut MsgPlaceLimitOrderResponse| { &mut m.taker_coin_out }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgPlaceLimitOrderResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgPlaceLimitOrderResponse { + const NAME: &'static str = "MsgPlaceLimitOrderResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.trancheKey = is.read_string()?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.coin_in)?; + }, + 26 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.taker_coin_out)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.trancheKey.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.trancheKey); + } + if let Some(v) = self.coin_in.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + if let Some(v) = self.taker_coin_out.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.trancheKey.is_empty() { + os.write_string(1, &self.trancheKey)?; + } + if let Some(v) = self.coin_in.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + if let Some(v) = self.taker_coin_out.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgPlaceLimitOrderResponse { + MsgPlaceLimitOrderResponse::new() + } + + fn clear(&mut self) { + self.trancheKey.clear(); + self.coin_in.clear(); + self.taker_coin_out.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgPlaceLimitOrderResponse { + static instance: MsgPlaceLimitOrderResponse = MsgPlaceLimitOrderResponse { + trancheKey: ::std::string::String::new(), + coin_in: ::protobuf::MessageField::none(), + taker_coin_out: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgPlaceLimitOrderResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgPlaceLimitOrderResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgPlaceLimitOrderResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgPlaceLimitOrderResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawFilledLimitOrder) +pub struct MsgWithdrawFilledLimitOrder { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawFilledLimitOrder.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawFilledLimitOrder.tranche_key) + pub tranche_key: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawFilledLimitOrder.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgWithdrawFilledLimitOrder { + fn default() -> &'a MsgWithdrawFilledLimitOrder { + ::default_instance() + } +} + +impl MsgWithdrawFilledLimitOrder { + pub fn new() -> MsgWithdrawFilledLimitOrder { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgWithdrawFilledLimitOrder| { &m.creator }, + |m: &mut MsgWithdrawFilledLimitOrder| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tranche_key", + |m: &MsgWithdrawFilledLimitOrder| { &m.tranche_key }, + |m: &mut MsgWithdrawFilledLimitOrder| { &mut m.tranche_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgWithdrawFilledLimitOrder", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgWithdrawFilledLimitOrder { + const NAME: &'static str = "MsgWithdrawFilledLimitOrder"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.tranche_key = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.tranche_key.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.tranche_key); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.tranche_key.is_empty() { + os.write_string(2, &self.tranche_key)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgWithdrawFilledLimitOrder { + MsgWithdrawFilledLimitOrder::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.tranche_key.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgWithdrawFilledLimitOrder { + static instance: MsgWithdrawFilledLimitOrder = MsgWithdrawFilledLimitOrder { + creator: ::std::string::String::new(), + tranche_key: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgWithdrawFilledLimitOrder { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawFilledLimitOrder").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgWithdrawFilledLimitOrder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgWithdrawFilledLimitOrder { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawFilledLimitOrderResponse) +pub struct MsgWithdrawFilledLimitOrderResponse { + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawFilledLimitOrderResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgWithdrawFilledLimitOrderResponse { + fn default() -> &'a MsgWithdrawFilledLimitOrderResponse { + ::default_instance() + } +} + +impl MsgWithdrawFilledLimitOrderResponse { + pub fn new() -> MsgWithdrawFilledLimitOrderResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgWithdrawFilledLimitOrderResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgWithdrawFilledLimitOrderResponse { + const NAME: &'static str = "MsgWithdrawFilledLimitOrderResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgWithdrawFilledLimitOrderResponse { + MsgWithdrawFilledLimitOrderResponse::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgWithdrawFilledLimitOrderResponse { + static instance: MsgWithdrawFilledLimitOrderResponse = MsgWithdrawFilledLimitOrderResponse { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgWithdrawFilledLimitOrderResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawFilledLimitOrderResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgWithdrawFilledLimitOrderResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgWithdrawFilledLimitOrderResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgCancelLimitOrder) +pub struct MsgCancelLimitOrder { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgCancelLimitOrder.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgCancelLimitOrder.tranche_key) + pub tranche_key: ::std::string::String, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgCancelLimitOrder.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgCancelLimitOrder { + fn default() -> &'a MsgCancelLimitOrder { + ::default_instance() + } +} + +impl MsgCancelLimitOrder { + pub fn new() -> MsgCancelLimitOrder { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgCancelLimitOrder| { &m.creator }, + |m: &mut MsgCancelLimitOrder| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "tranche_key", + |m: &MsgCancelLimitOrder| { &m.tranche_key }, + |m: &mut MsgCancelLimitOrder| { &mut m.tranche_key }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgCancelLimitOrder", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgCancelLimitOrder { + const NAME: &'static str = "MsgCancelLimitOrder"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.tranche_key = is.read_string()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.tranche_key.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.tranche_key); + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.tranche_key.is_empty() { + os.write_string(2, &self.tranche_key)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgCancelLimitOrder { + MsgCancelLimitOrder::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.tranche_key.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgCancelLimitOrder { + static instance: MsgCancelLimitOrder = MsgCancelLimitOrder { + creator: ::std::string::String::new(), + tranche_key: ::std::string::String::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgCancelLimitOrder { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgCancelLimitOrder").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgCancelLimitOrder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgCancelLimitOrder { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgCancelLimitOrderResponse) +pub struct MsgCancelLimitOrderResponse { + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgCancelLimitOrderResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgCancelLimitOrderResponse { + fn default() -> &'a MsgCancelLimitOrderResponse { + ::default_instance() + } +} + +impl MsgCancelLimitOrderResponse { + pub fn new() -> MsgCancelLimitOrderResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgCancelLimitOrderResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgCancelLimitOrderResponse { + const NAME: &'static str = "MsgCancelLimitOrderResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgCancelLimitOrderResponse { + MsgCancelLimitOrderResponse::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgCancelLimitOrderResponse { + static instance: MsgCancelLimitOrderResponse = MsgCancelLimitOrderResponse { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgCancelLimitOrderResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgCancelLimitOrderResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgCancelLimitOrderResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgCancelLimitOrderResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MultiHopRoute) +pub struct MultiHopRoute { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MultiHopRoute.hops) + pub hops: ::std::vec::Vec<::std::string::String>, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MultiHopRoute.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MultiHopRoute { + fn default() -> &'a MultiHopRoute { + ::default_instance() + } +} + +impl MultiHopRoute { + pub fn new() -> MultiHopRoute { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "hops", + |m: &MultiHopRoute| { &m.hops }, + |m: &mut MultiHopRoute| { &mut m.hops }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MultiHopRoute", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MultiHopRoute { + const NAME: &'static str = "MultiHopRoute"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.hops.push(is.read_string()?); + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + for value in &self.hops { + my_size += ::protobuf::rt::string_size(1, &value); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + for v in &self.hops { + os.write_string(1, &v)?; + }; + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MultiHopRoute { + MultiHopRoute::new() + } + + fn clear(&mut self) { + self.hops.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MultiHopRoute { + static instance: MultiHopRoute = MultiHopRoute { + hops: ::std::vec::Vec::new(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MultiHopRoute { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MultiHopRoute").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MultiHopRoute { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MultiHopRoute { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgMultiHopSwap) +pub struct MsgMultiHopSwap { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.creator) + pub creator: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.receiver) + pub receiver: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.routes) + pub routes: ::std::vec::Vec, + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.amount_in) + pub amount_in: ::std::string::String, + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.exit_limit_price) + pub exit_limit_price: ::std::string::String, + /// If pickBestRoute == true then all routes are run and the route with the best price is chosen + /// otherwise, the first succesful route is used. + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.pick_best_route) + pub pick_best_route: bool, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgMultiHopSwap.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgMultiHopSwap { + fn default() -> &'a MsgMultiHopSwap { + ::default_instance() + } +} + +impl MsgMultiHopSwap { + pub fn new() -> MsgMultiHopSwap { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(6); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "creator", + |m: &MsgMultiHopSwap| { &m.creator }, + |m: &mut MsgMultiHopSwap| { &mut m.creator }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "receiver", + |m: &MsgMultiHopSwap| { &m.receiver }, + |m: &mut MsgMultiHopSwap| { &mut m.receiver }, + )); + fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( + "routes", + |m: &MsgMultiHopSwap| { &m.routes }, + |m: &mut MsgMultiHopSwap| { &mut m.routes }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "amount_in", + |m: &MsgMultiHopSwap| { &m.amount_in }, + |m: &mut MsgMultiHopSwap| { &mut m.amount_in }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "exit_limit_price", + |m: &MsgMultiHopSwap| { &m.exit_limit_price }, + |m: &mut MsgMultiHopSwap| { &mut m.exit_limit_price }, + )); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "pick_best_route", + |m: &MsgMultiHopSwap| { &m.pick_best_route }, + |m: &mut MsgMultiHopSwap| { &mut m.pick_best_route }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgMultiHopSwap", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgMultiHopSwap { + const NAME: &'static str = "MsgMultiHopSwap"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.creator = is.read_string()?; + }, + 18 => { + self.receiver = is.read_string()?; + }, + 26 => { + self.routes.push(is.read_message()?); + }, + 34 => { + self.amount_in = is.read_string()?; + }, + 42 => { + self.exit_limit_price = is.read_string()?; + }, + 48 => { + self.pick_best_route = is.read_bool()?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.creator.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.creator); + } + if !self.receiver.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.receiver); + } + for value in &self.routes { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + }; + if !self.amount_in.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.amount_in); + } + if !self.exit_limit_price.is_empty() { + my_size += ::protobuf::rt::string_size(5, &self.exit_limit_price); + } + if self.pick_best_route != false { + my_size += 1 + 1; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.creator.is_empty() { + os.write_string(1, &self.creator)?; + } + if !self.receiver.is_empty() { + os.write_string(2, &self.receiver)?; + } + for v in &self.routes { + ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; + }; + if !self.amount_in.is_empty() { + os.write_string(4, &self.amount_in)?; + } + if !self.exit_limit_price.is_empty() { + os.write_string(5, &self.exit_limit_price)?; + } + if self.pick_best_route != false { + os.write_bool(6, self.pick_best_route)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgMultiHopSwap { + MsgMultiHopSwap::new() + } + + fn clear(&mut self) { + self.creator.clear(); + self.receiver.clear(); + self.routes.clear(); + self.amount_in.clear(); + self.exit_limit_price.clear(); + self.pick_best_route = false; + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgMultiHopSwap { + static instance: MsgMultiHopSwap = MsgMultiHopSwap { + creator: ::std::string::String::new(), + receiver: ::std::string::String::new(), + routes: ::std::vec::Vec::new(), + amount_in: ::std::string::String::new(), + exit_limit_price: ::std::string::String::new(), + pick_best_route: false, + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgMultiHopSwap { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgMultiHopSwap").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgMultiHopSwap { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgMultiHopSwap { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgMultiHopSwapResponse) +pub struct MsgMultiHopSwapResponse { + // message fields + // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwapResponse.coin_out) + pub coin_out: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgMultiHopSwapResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgMultiHopSwapResponse { + fn default() -> &'a MsgMultiHopSwapResponse { + ::default_instance() + } +} + +impl MsgMultiHopSwapResponse { + pub fn new() -> MsgMultiHopSwapResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(1); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( + "coin_out", + |m: &MsgMultiHopSwapResponse| { &m.coin_out }, + |m: &mut MsgMultiHopSwapResponse| { &mut m.coin_out }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgMultiHopSwapResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgMultiHopSwapResponse { + const NAME: &'static str = "MsgMultiHopSwapResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.coin_out)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if let Some(v) = self.coin_out.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if let Some(v) = self.coin_out.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgMultiHopSwapResponse { + MsgMultiHopSwapResponse::new() + } + + fn clear(&mut self) { + self.coin_out.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgMultiHopSwapResponse { + static instance: MsgMultiHopSwapResponse = MsgMultiHopSwapResponse { + coin_out: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgMultiHopSwapResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgMultiHopSwapResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgMultiHopSwapResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgMultiHopSwapResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgUpdateParams) +pub struct MsgUpdateParams { + // message fields + /// Authority is the address of the governance account. + // @@protoc_insertion_point(field:neutron.dex.MsgUpdateParams.authority) + pub authority: ::std::string::String, + /// NOTE: All parameters must be supplied. + // @@protoc_insertion_point(field:neutron.dex.MsgUpdateParams.params) + pub params: ::protobuf::MessageField, + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgUpdateParams.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgUpdateParams { + fn default() -> &'a MsgUpdateParams { + ::default_instance() + } +} + +impl MsgUpdateParams { + pub fn new() -> MsgUpdateParams { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(2); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( + "authority", + |m: &MsgUpdateParams| { &m.authority }, + |m: &mut MsgUpdateParams| { &mut m.authority }, + )); + fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::params::Params>( + "params", + |m: &MsgUpdateParams| { &m.params }, + |m: &mut MsgUpdateParams| { &mut m.params }, + )); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgUpdateParams", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + 10 => { + self.authority = is.read_string()?; + }, + 18 => { + ::protobuf::rt::read_singular_message_into_field(is, &mut self.params)?; + }, + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + if !self.authority.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.authority); + } + if let Some(v) = self.params.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + if !self.authority.is_empty() { + os.write_string(1, &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; + } + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgUpdateParams { + MsgUpdateParams::new() + } + + fn clear(&mut self) { + self.authority.clear(); + self.params.clear(); + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgUpdateParams { + static instance: MsgUpdateParams = MsgUpdateParams { + authority: ::std::string::String::new(), + params: ::protobuf::MessageField::none(), + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgUpdateParams { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgUpdateParams").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgUpdateParams { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgUpdateParams { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(PartialEq,Clone,Default,Debug)] +// @@protoc_insertion_point(message:neutron.dex.MsgUpdateParamsResponse) +pub struct MsgUpdateParamsResponse { + // special fields + // @@protoc_insertion_point(special_field:neutron.dex.MsgUpdateParamsResponse.special_fields) + pub special_fields: ::protobuf::SpecialFields, +} + +impl<'a> ::std::default::Default for &'a MsgUpdateParamsResponse { + fn default() -> &'a MsgUpdateParamsResponse { + ::default_instance() + } +} + +impl MsgUpdateParamsResponse { + pub fn new() -> MsgUpdateParamsResponse { + ::std::default::Default::default() + } + + fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { + let mut fields = ::std::vec::Vec::with_capacity(0); + let mut oneofs = ::std::vec::Vec::with_capacity(0); + ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( + "MsgUpdateParamsResponse", + fields, + oneofs, + ) + } +} + +impl ::protobuf::Message for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { + while let Some(tag) = is.read_raw_tag_or_eof()? { + match tag { + tag => { + ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u64 { + let mut my_size = 0; + my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); + self.special_fields.cached_size().set(my_size as u32); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { + os.write_unknown_fields(self.special_fields.unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn special_fields(&self) -> &::protobuf::SpecialFields { + &self.special_fields + } + + fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { + &mut self.special_fields + } + + fn new() -> MsgUpdateParamsResponse { + MsgUpdateParamsResponse::new() + } + + fn clear(&mut self) { + self.special_fields.clear(); + } + + fn default_instance() -> &'static MsgUpdateParamsResponse { + static instance: MsgUpdateParamsResponse = MsgUpdateParamsResponse { + special_fields: ::protobuf::SpecialFields::new(), + }; + &instance + } +} + +impl ::protobuf::MessageFull for MsgUpdateParamsResponse { + fn descriptor() -> ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgUpdateParamsResponse").unwrap()).clone() + } +} + +impl ::std::fmt::Display for MsgUpdateParamsResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MsgUpdateParamsResponse { + type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; +} + +#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] +// @@protoc_insertion_point(enum:neutron.dex.LimitOrderType) +pub enum LimitOrderType { + // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.GOOD_TIL_CANCELLED) + GOOD_TIL_CANCELLED = 0, + // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.FILL_OR_KILL) + FILL_OR_KILL = 1, + // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.IMMEDIATE_OR_CANCEL) + IMMEDIATE_OR_CANCEL = 2, + // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.JUST_IN_TIME) + JUST_IN_TIME = 3, + // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.GOOD_TIL_TIME) + GOOD_TIL_TIME = 4, +} + +impl ::protobuf::Enum for LimitOrderType { + const NAME: &'static str = "LimitOrderType"; + + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(LimitOrderType::GOOD_TIL_CANCELLED), + 1 => ::std::option::Option::Some(LimitOrderType::FILL_OR_KILL), + 2 => ::std::option::Option::Some(LimitOrderType::IMMEDIATE_OR_CANCEL), + 3 => ::std::option::Option::Some(LimitOrderType::JUST_IN_TIME), + 4 => ::std::option::Option::Some(LimitOrderType::GOOD_TIL_TIME), + _ => ::std::option::Option::None + } + } + + const VALUES: &'static [LimitOrderType] = &[ + LimitOrderType::GOOD_TIL_CANCELLED, + LimitOrderType::FILL_OR_KILL, + LimitOrderType::IMMEDIATE_OR_CANCEL, + LimitOrderType::JUST_IN_TIME, + LimitOrderType::GOOD_TIL_TIME, + ]; +} + +impl ::protobuf::EnumFull for LimitOrderType { + fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); + descriptor.get(|| file_descriptor().enum_by_package_relative_name("LimitOrderType").unwrap()).clone() + } + + fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { + let index = *self as usize; + Self::enum_descriptor().value_by_index(index) + } +} + +impl ::std::default::Default for LimitOrderType { + fn default() -> Self { + LimitOrderType::GOOD_TIL_CANCELLED + } +} + +impl LimitOrderType { + fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { + ::protobuf::reflect::GeneratedEnumDescriptorData::new::("LimitOrderType") + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14neutron/dex/tx.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.prot\ + o\x1a\x1ecosmos/base/v1beta1/coin.proto\x1a\x1fgoogle/protobuf/timestamp\ + .proto\x1a\x11amino/amino.proto\x1a\x18neutron/dex/params.proto\x1a\x17c\ + osmos/msg/v1/msg.proto\x1a\x19cosmos_proto/cosmos.proto\";\n\x0eDepositO\ + ptions\x12)\n\x10disable_autoswap\x18\x01\x20\x01(\x08R\x0fdisableAutosw\ + ap\"\xc9\x03\n\nMsgDeposit\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07c\ + reator\x12\x1a\n\x08receiver\x18\x02\x20\x01(\tR\x08receiver\x12\x17\n\ + \x07token_a\x18\x03\x20\x01(\tR\x06tokenA\x12\x17\n\x07token_b\x18\x04\ + \x20\x01(\tR\x06tokenB\x12l\n\tamounts_a\x18\x05\x20\x03(\tR\x08amountsA\ + BO\xf2\xde\x1f\x10yaml:\"amounts_a\"\xda\xde\x1f&github.com/cosmos/cosmo\ + s-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamounts_a\x12l\n\tamounts_b\ + \x18\x06\x20\x03(\tR\x08amountsBBO\xf2\xde\x1f\x10yaml:\"amounts_b\"\xda\ + \xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\ + \x1f\tamounts_b\x12,\n\x13tick_indexes_a_to_b\x18\x07\x20\x03(\x03R\x0ft\ + ickIndexesAToB\x12\x12\n\x04fees\x18\x08\x20\x03(\x04R\x04fees\x125\n\ + \x07options\x18\t\x20\x03(\x0b2\x1b.neutron.dex.DepositOptionsR\x07optio\ + ns\"\xba\x02\n\x12MsgDepositResponse\x12\x90\x01\n\x12reserve0_deposited\ + \x18\x01\x20\x03(\tR\x11reserve0DepositedBa\xf2\xde\x1f\x19yaml:\"reserv\ + e0_deposited\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\ + \xde\x1f\0\xea\xde\x1f\x12reserve0_deposited\x12\x90\x01\n\x12reserve1_d\ + eposited\x18\x02\x20\x03(\tR\x11reserve1DepositedBa\xf2\xde\x1f\x19yaml:\ + \"reserve1_deposited\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.In\ + t\xc8\xde\x1f\0\xea\xde\x1f\x12reserve1_deposited\"\xc3\x02\n\rMsgWithdr\ + awal\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1a\n\x08re\ + ceiver\x18\x02\x20\x01(\tR\x08receiver\x12\x17\n\x07token_a\x18\x03\x20\ + \x01(\tR\x06tokenA\x12\x17\n\x07token_b\x18\x04\x20\x01(\tR\x06tokenB\ + \x12\x87\x01\n\x10shares_to_remove\x18\x05\x20\x03(\tR\x0esharesToRemove\ + B]\xf2\xde\x1f\x17yaml:\"shares_to_remove\"\xda\xde\x1f&github.com/cosmo\ + s/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\x10shares_to_remove\x12\ + ,\n\x13tick_indexes_a_to_b\x18\x06\x20\x03(\x03R\x0ftickIndexesAToB\x12\ + \x12\n\x04fees\x18\x07\x20\x03(\x04R\x04fees\"\x17\n\x15MsgWithdrawalRes\ + ponse\"\xac\x04\n\x12MsgPlaceLimitOrder\x12\x18\n\x07creator\x18\x01\x20\ + \x01(\tR\x07creator\x12\x1a\n\x08receiver\x18\x02\x20\x01(\tR\x08receive\ + r\x12\x19\n\x08token_in\x18\x03\x20\x01(\tR\x07tokenIn\x12\x1b\n\ttoken_\ + out\x18\x04\x20\x01(\tR\x08tokenOut\x12.\n\x14tick_index_in_to_out\x18\ + \x05\x20\x01(\x03R\x10tickIndexInToOut\x12l\n\tamount_in\x18\x07\x20\x01\ + (\tR\x08amountInBO\xf2\xde\x1f\x10yaml:\"amount_in\"\xda\xde\x1f&github.\ + com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamount_in\x12\ + :\n\norder_type\x18\x08\x20\x01(\x0e2\x1b.neutron.dex.LimitOrderTypeR\to\ + rderType\x12M\n\x0fexpiration_time\x18\t\x20\x01(\x0b2\x1a.google.protob\ + uf.TimestampR\x0eexpirationTimeB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x01\x12\ + \x7f\n\x0emax_amount_out\x18\n\x20\x01(\tR\x0cmaxAmountOutBY\xf2\xde\x1f\ + \x15yaml:\"max_amount_out\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/typ\ + es.Int\xc8\xde\x1f\x01\xea\xde\x1f\x0emax_amount_out\"\xdd\x02\n\x1aMsgP\ + laceLimitOrderResponse\x12\x1e\n\ntrancheKey\x18\x01\x20\x01(\tR\ntranch\ + eKey\x12\x80\x01\n\x07coin_in\x18\x02\x20\x01(\x0b2\x19.cosmos.base.v1be\ + ta1.CoinR\x06coinInBL\xf2\xde\x1f\x0eyaml:\"coin_in\"\xc8\xde\x1f\0\xda\ + \xde\x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\xde\x1f\x07coin_in\ + \x12\x9b\x01\n\x0etaker_coin_out\x18\x03\x20\x01(\x0b2\x19.cosmos.base.v\ + 1beta1.CoinR\x0ctakerCoinOutBZ\xf2\xde\x1f\x15yaml:\"taker_coin_out\"\ + \xc8\xde\x1f\0\xda\xde\x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\ + \xde\x1f\x0etaker_coin_out\"X\n\x1bMsgWithdrawFilledLimitOrder\x12\x18\n\ + \x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1f\n\x0btranche_key\x18\ + \x02\x20\x01(\tR\ntrancheKey\"%\n#MsgWithdrawFilledLimitOrderResponse\"P\ + \n\x13MsgCancelLimitOrder\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07cr\ + eator\x12\x1f\n\x0btranche_key\x18\x02\x20\x01(\tR\ntrancheKey\"\x1d\n\ + \x1bMsgCancelLimitOrderResponse\"#\n\rMultiHopRoute\x12\x12\n\x04hops\ + \x18\x01\x20\x03(\tR\x04hops\"\xa6\x03\n\x0fMsgMultiHopSwap\x12\x18\n\ + \x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1a\n\x08receiver\x18\x02\ + \x20\x01(\tR\x08receiver\x122\n\x06routes\x18\x03\x20\x03(\x0b2\x1a.neut\ + ron.dex.MultiHopRouteR\x06routes\x12l\n\tamount_in\x18\x04\x20\x01(\tR\ + \x08amountInBO\xf2\xde\x1f\x10yaml:\"amount_in\"\xda\xde\x1f&github.com/\ + cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamount_in\x12\x92\ + \x01\n\x10exit_limit_price\x18\x05\x20\x01(\tR\x0eexitLimitPriceBh\xf2\ + \xde\x1f\x17yaml:\"exit_limit_price\"\xda\xde\x1f1github.com/neutron-org\ + /neutron/utils/math.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x10exit_limit_pric\ + e\x12&\n\x0fpick_best_route\x18\x06\x20\x01(\x08R\rpickBestRoute\"\x8c\ + \x01\n\x17MsgMultiHopSwapResponse\x12q\n\x08coin_out\x18\x01\x20\x01(\ + \x0b2\x19.cosmos.base.v1beta1.CoinR\x07coinOutB;\xc8\xde\x1f\0\xda\xde\ + \x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\xde\x1f\x08coin_out\"\ + \xa9\x01\n\x0fMsgUpdateParams\x126\n\tauthority\x18\x01\x20\x01(\tR\taut\ + horityB\x18\xd2\xb4-\x14cosmos.AddressString\x126\n\x06params\x18\x02\ + \x20\x01(\x0b2\x13.neutron.dex.ParamsR\x06paramsB\t\xc8\xde\x1f\0\xa8\ + \xe7\xb0*\x01:&\x8a\xe7\xb0*\x13dex/MsgUpdateParams\x82\xe7\xb0*\tauthor\ + ity\"\x19\n\x17MsgUpdateParamsResponse*x\n\x0eLimitOrderType\x12\x16\n\ + \x12GOOD_TIL_CANCELLED\x10\0\x12\x10\n\x0cFILL_OR_KILL\x10\x01\x12\x17\n\ + \x13IMMEDIATE_OR_CANCEL\x10\x02\x12\x10\n\x0cJUST_IN_TIME\x10\x03\x12\ + \x11\n\rGOOD_TIL_TIME\x10\x042\xf5\x04\n\x03Msg\x12C\n\x07Deposit\x12\ + \x17.neutron.dex.MsgDeposit\x1a\x1f.neutron.dex.MsgDepositResponse\x12L\ + \n\nWithdrawal\x12\x1a.neutron.dex.MsgWithdrawal\x1a\".neutron.dex.MsgWi\ + thdrawalResponse\x12[\n\x0fPlaceLimitOrder\x12\x1f.neutron.dex.MsgPlaceL\ + imitOrder\x1a'.neutron.dex.MsgPlaceLimitOrderResponse\x12v\n\x18Withdraw\ + FilledLimitOrder\x12(.neutron.dex.MsgWithdrawFilledLimitOrder\x1a0.neutr\ + on.dex.MsgWithdrawFilledLimitOrderResponse\x12^\n\x10CancelLimitOrder\ + \x12\x20.neutron.dex.MsgCancelLimitOrder\x1a(.neutron.dex.MsgCancelLimit\ + OrderResponse\x12R\n\x0cMultiHopSwap\x12\x1c.neutron.dex.MsgMultiHopSwap\ + \x1a$.neutron.dex.MsgMultiHopSwapResponse\x12R\n\x0cUpdateParams\x12\x1c\ + .neutron.dex.MsgUpdateParams\x1a$.neutron.dex.MsgUpdateParamsResponseB,Z\ + *github.com/neutron-org/neutron/x/dex/typesJ\xf7.\n\x07\x12\x05\0\0\xcd\ + \x01\"\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\ + \n\x08\n\x01\x08\x12\x03\x05\0A\nH\n\x02\x08\x0b\x12\x03\x05\0A2=\x20thi\ + s\x20line\x20is\x20used\x20by\x20starport\x20scaffolding\x20#\x20proto/t\ + x/import\n\n\t\n\x02\x03\0\x12\x03\x06\0\x1e\n\t\n\x02\x03\x01\x12\x03\ + \x07\0(\n\t\n\x02\x03\x02\x12\x03\x08\0)\n\t\n\x02\x03\x03\x12\x03\t\0\ + \x1b\n\t\n\x02\x03\x04\x12\x03\n\0\"\n\t\n\x02\x03\x05\x12\x03\x0b\0!\n\ + \t\n\x02\x03\x06\x12\x03\x0c\0#\n*\n\x02\x06\0\x12\x04\x0f\0\x18\x01\x1a\ + \x1e\x20Msg\x20defines\x20the\x20Msg\x20service.\n\n\n\n\x03\x06\0\x01\ + \x12\x03\x0f\x08\x0b\n\x0b\n\x04\x06\0\x02\0\x12\x03\x10\x027\n\x0c\n\ + \x05\x06\0\x02\0\x01\x12\x03\x10\x06\r\n\x0c\n\x05\x06\0\x02\0\x02\x12\ + \x03\x10\x0e\x18\n\x0c\n\x05\x06\0\x02\0\x03\x12\x03\x10#5\n\x0b\n\x04\ + \x06\0\x02\x01\x12\x03\x11\x02@\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x03\ + \x11\x06\x10\n\x0c\n\x05\x06\0\x02\x01\x02\x12\x03\x11\x11\x1e\n\x0c\n\ + \x05\x06\0\x02\x01\x03\x12\x03\x11)>\n\x0b\n\x04\x06\0\x02\x02\x12\x03\ + \x12\x02O\n\x0c\n\x05\x06\0\x02\x02\x01\x12\x03\x12\x06\x15\n\x0c\n\x05\ + \x06\0\x02\x02\x02\x12\x03\x12\x16(\n\x0c\n\x05\x06\0\x02\x02\x03\x12\ + \x03\x123M\n\x0b\n\x04\x06\0\x02\x03\x12\x03\x13\x02j\n\x0c\n\x05\x06\0\ + \x02\x03\x01\x12\x03\x13\x06\x1e\n\x0c\n\x05\x06\0\x02\x03\x02\x12\x03\ + \x13\x1f:\n\x0c\n\x05\x06\0\x02\x03\x03\x12\x03\x13Eh\n\x0b\n\x04\x06\0\ + \x02\x04\x12\x03\x14\x02R\n\x0c\n\x05\x06\0\x02\x04\x01\x12\x03\x14\x06\ + \x16\n\x0c\n\x05\x06\0\x02\x04\x02\x12\x03\x14\x17*\n\x0c\n\x05\x06\0\ + \x02\x04\x03\x12\x03\x145P\n\x0b\n\x04\x06\0\x02\x05\x12\x03\x15\x02F\n\ + \x0c\n\x05\x06\0\x02\x05\x01\x12\x03\x15\x06\x12\n\x0c\n\x05\x06\0\x02\ + \x05\x02\x12\x03\x15\x13\"\n\x0c\n\x05\x06\0\x02\x05\x03\x12\x03\x15-D\n\ + G\n\x04\x06\0\x02\x06\x12\x03\x16\x02F\":\x20this\x20line\x20is\x20used\ + \x20by\x20starport\x20scaffolding\x20#\x20proto/tx/rpc\n\n\x0c\n\x05\x06\ + \0\x02\x06\x01\x12\x03\x16\x06\x12\n\x0c\n\x05\x06\0\x02\x06\x02\x12\x03\ + \x16\x13\"\n\x0c\n\x05\x06\0\x02\x06\x03\x12\x03\x16-D\n\n\n\x02\x04\0\ + \x12\x04\x1a\0\x1c\x01\n\n\n\x03\x04\0\x01\x12\x03\x1a\x08\x16\n\x0b\n\ + \x04\x04\0\x02\0\x12\x03\x1b\x02\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\ + \x1b\x02\x06\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x1b\x07\x17\n\x0c\n\x05\ + \x04\0\x02\0\x03\x12\x03\x1b\x1a\x1b\n\n\n\x02\x04\x01\x12\x04\x1e\02\ + \x01\n\n\n\x03\x04\x01\x01\x12\x03\x1e\x08\x12\n\x0b\n\x04\x04\x01\x02\0\ + \x12\x03\x1f\x02\x15\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x1f\x02\x08\n\ + \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x1f\t\x10\n\x0c\n\x05\x04\x01\x02\0\ + \x03\x12\x03\x1f\x13\x14\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x20\x02\x16\ + \n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x20\x02\x08\n\x0c\n\x05\x04\x01\ + \x02\x01\x01\x12\x03\x20\t\x11\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\ + \x20\x14\x15\n\x0b\n\x04\x04\x01\x02\x02\x12\x03!\x02\x15\n\x0c\n\x05\ + \x04\x01\x02\x02\x05\x12\x03!\x02\x08\n\x0c\n\x05\x04\x01\x02\x02\x01\ + \x12\x03!\t\x10\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03!\x13\x14\n\x0b\n\ + \x04\x04\x01\x02\x03\x12\x03\"\x02\x15\n\x0c\n\x05\x04\x01\x02\x03\x05\ + \x12\x03\"\x02\x08\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\"\t\x10\n\x0c\ + \n\x05\x04\x01\x02\x03\x03\x12\x03\"\x13\x14\n\x0c\n\x04\x04\x01\x02\x04\ + \x12\x04#\x02(\x04\n\x0c\n\x05\x04\x01\x02\x04\x04\x12\x03#\x02\n\n\x0c\ + \n\x05\x04\x01\x02\x04\x05\x12\x03#\x0b\x11\n\x0c\n\x05\x04\x01\x02\x04\ + \x01\x12\x03#\x12\x1b\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03#\x1e\x1f\n\ + \r\n\x05\x04\x01\x02\x04\x08\x12\x04#!(\x03\n\x0f\n\x08\x04\x01\x02\x04\ + \x08\xee\xfb\x03\x12\x03$\x063\n\x0f\n\x08\x04\x01\x02\x04\x08\xeb\xfb\ + \x03\x12\x03%\x06G\n\x0f\n\x08\x04\x01\x02\x04\x08\xe9\xfb\x03\x12\x03&\ + \x06$\n\x0f\n\x08\x04\x01\x02\x04\x08\xed\xfb\x03\x12\x03'\x06'\n\x0c\n\ + \x04\x04\x01\x02\x05\x12\x04)\x03.\x04\n\x0c\n\x05\x04\x01\x02\x05\x04\ + \x12\x03)\x03\x0b\n\x0c\n\x05\x04\x01\x02\x05\x05\x12\x03)\x0c\x12\n\x0c\ + \n\x05\x04\x01\x02\x05\x01\x12\x03)\x13\x1c\n\x0c\n\x05\x04\x01\x02\x05\ + \x03\x12\x03)\x1f\x20\n\r\n\x05\x04\x01\x02\x05\x08\x12\x04)\".\x03\n\ + \x0f\n\x08\x04\x01\x02\x05\x08\xee\xfb\x03\x12\x03*\x063\n\x0f\n\x08\x04\ + \x01\x02\x05\x08\xeb\xfb\x03\x12\x03+\x06G\n\x0f\n\x08\x04\x01\x02\x05\ + \x08\xe9\xfb\x03\x12\x03,\x06$\n\x0f\n\x08\x04\x01\x02\x05\x08\xed\xfb\ + \x03\x12\x03-\x06'\n\x0b\n\x04\x04\x01\x02\x06\x12\x03/\x02)\n\x0c\n\x05\ + \x04\x01\x02\x06\x04\x12\x03/\x02\n\n\x0c\n\x05\x04\x01\x02\x06\x05\x12\ + \x03/\x0b\x10\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x03/\x11$\n\x0c\n\x05\ + \x04\x01\x02\x06\x03\x12\x03/'(\n\x0b\n\x04\x04\x01\x02\x07\x12\x030\x02\ + \x1b\n\x0c\n\x05\x04\x01\x02\x07\x04\x12\x030\x02\n\n\x0c\n\x05\x04\x01\ + \x02\x07\x05\x12\x030\x0b\x11\n\x0c\n\x05\x04\x01\x02\x07\x01\x12\x030\ + \x12\x16\n\x0c\n\x05\x04\x01\x02\x07\x03\x12\x030\x19\x1a\n\x0b\n\x04\ + \x04\x01\x02\x08\x12\x031\x02&\n\x0c\n\x05\x04\x01\x02\x08\x04\x12\x031\ + \x02\n\n\x0c\n\x05\x04\x01\x02\x08\x06\x12\x031\x0b\x19\n\x0c\n\x05\x04\ + \x01\x02\x08\x01\x12\x031\x1a!\n\x0c\n\x05\x04\x01\x02\x08\x03\x12\x031$\ + %\n\n\n\x02\x04\x02\x12\x044\0A\x01\n\n\n\x03\x04\x02\x01\x12\x034\x08\ + \x1a\n\x0c\n\x04\x04\x02\x02\0\x12\x045\x03:\x04\n\x0c\n\x05\x04\x02\x02\ + \0\x04\x12\x035\x03\x0b\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x035\x0c\x12\n\ + \x0c\n\x05\x04\x02\x02\0\x01\x12\x035\x13%\n\x0c\n\x05\x04\x02\x02\0\x03\ + \x12\x035()\n\r\n\x05\x04\x02\x02\0\x08\x12\x045*:\x03\n\x0f\n\x08\x04\ + \x02\x02\0\x08\xee\xfb\x03\x12\x036\x06<\n\x0f\n\x08\x04\x02\x02\0\x08\ + \xeb\xfb\x03\x12\x037\x06G\n\x0f\n\x08\x04\x02\x02\0\x08\xe9\xfb\x03\x12\ + \x038\x06$\n\x0f\n\x08\x04\x02\x02\0\x08\xed\xfb\x03\x12\x039\x060\n\x0c\ + \n\x04\x04\x02\x02\x01\x12\x04;\x02@\x04\n\x0c\n\x05\x04\x02\x02\x01\x04\ + \x12\x03;\x02\n\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03;\x0b\x11\n\x0c\n\ + \x05\x04\x02\x02\x01\x01\x12\x03;\x12$\n\x0c\n\x05\x04\x02\x02\x01\x03\ + \x12\x03;'(\n\r\n\x05\x04\x02\x02\x01\x08\x12\x04;(@\x03\n\x0f\n\x08\x04\ + \x02\x02\x01\x08\xee\xfb\x03\x12\x03<\x06<\n\x0f\n\x08\x04\x02\x02\x01\ + \x08\xeb\xfb\x03\x12\x03=\x06G\n\x0f\n\x08\x04\x02\x02\x01\x08\xe9\xfb\ + \x03\x12\x03>\x06$\n\x0f\n\x08\x04\x02\x02\x01\x08\xed\xfb\x03\x12\x03?\ + \x060\n\n\n\x02\x04\x03\x12\x04C\0Q\x01\n\n\n\x03\x04\x03\x01\x12\x03C\ + \x08\x15\n\x0b\n\x04\x04\x03\x02\0\x12\x03D\x02\x15\n\x0c\n\x05\x04\x03\ + \x02\0\x05\x12\x03D\x02\x08\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03D\t\x10\ + \n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03D\x13\x14\n\x0b\n\x04\x04\x03\x02\ + \x01\x12\x03E\x02\x16\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03E\x02\x08\n\ + \x0c\n\x05\x04\x03\x02\x01\x01\x12\x03E\t\x11\n\x0c\n\x05\x04\x03\x02\ + \x01\x03\x12\x03E\x14\x15\n\x0b\n\x04\x04\x03\x02\x02\x12\x03F\x02\x15\n\ + \x0c\n\x05\x04\x03\x02\x02\x05\x12\x03F\x02\x08\n\x0c\n\x05\x04\x03\x02\ + \x02\x01\x12\x03F\t\x10\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03F\x13\x14\ + \n\x0b\n\x04\x04\x03\x02\x03\x12\x03G\x02\x15\n\x0c\n\x05\x04\x03\x02\ + \x03\x05\x12\x03G\x02\x08\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03G\t\x10\ + \n\x0c\n\x05\x04\x03\x02\x03\x03\x12\x03G\x13\x14\n\x0c\n\x04\x04\x03\ + \x02\x04\x12\x04H\x02M\x04\n\x0c\n\x05\x04\x03\x02\x04\x04\x12\x03H\x02\ + \n\n\x0c\n\x05\x04\x03\x02\x04\x05\x12\x03H\x0b\x11\n\x0c\n\x05\x04\x03\ + \x02\x04\x01\x12\x03H\x12\"\n\x0c\n\x05\x04\x03\x02\x04\x03\x12\x03H%&\n\ + \r\n\x05\x04\x03\x02\x04\x08\x12\x04H(M\x03\n\x0f\n\x08\x04\x03\x02\x04\ + \x08\xee\xfb\x03\x12\x03I\x06:\n\x0f\n\x08\x04\x03\x02\x04\x08\xeb\xfb\ + \x03\x12\x03J\x06G\n\x0f\n\x08\x04\x03\x02\x04\x08\xe9\xfb\x03\x12\x03K\ + \x06$\n\x0f\n\x08\x04\x03\x02\x04\x08\xed\xfb\x03\x12\x03L\x06.\n\x0b\n\ + \x04\x04\x03\x02\x05\x12\x03N\x02)\n\x0c\n\x05\x04\x03\x02\x05\x04\x12\ + \x03N\x02\n\n\x0c\n\x05\x04\x03\x02\x05\x05\x12\x03N\x0b\x10\n\x0c\n\x05\ + \x04\x03\x02\x05\x01\x12\x03N\x11$\n\x0c\n\x05\x04\x03\x02\x05\x03\x12\ + \x03N'(\n\x0b\n\x04\x04\x03\x02\x06\x12\x03O\x02\x1b\n\x0c\n\x05\x04\x03\ + \x02\x06\x04\x12\x03O\x02\n\n\x0c\n\x05\x04\x03\x02\x06\x05\x12\x03O\x0b\ + \x11\n\x0c\n\x05\x04\x03\x02\x06\x01\x12\x03O\x12\x16\n\x0c\n\x05\x04\ + \x03\x02\x06\x03\x12\x03O\x19\x1a\n\n\n\x02\x04\x04\x12\x04S\0T\x01\n\n\ + \n\x03\x04\x04\x01\x12\x03S\x08\x1d\n\n\n\x02\x05\0\x12\x04V\0\\\x01\n\n\ + \n\x03\x05\0\x01\x12\x03V\x05\x13\n\x0b\n\x04\x05\0\x02\0\x12\x03W\x02\ + \x19\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03W\x02\x14\n\x0c\n\x05\x05\0\x02\ + \0\x02\x12\x03W\x17\x18\n\x0b\n\x04\x05\0\x02\x01\x12\x03X\x02\x13\n\x0c\ + \n\x05\x05\0\x02\x01\x01\x12\x03X\x02\x0e\n\x0c\n\x05\x05\0\x02\x01\x02\ + \x12\x03X\x11\x12\n\x0b\n\x04\x05\0\x02\x02\x12\x03Y\x02\x1a\n\x0c\n\x05\ + \x05\0\x02\x02\x01\x12\x03Y\x02\x15\n\x0c\n\x05\x05\0\x02\x02\x02\x12\ + \x03Y\x18\x19\n\x0b\n\x04\x05\0\x02\x03\x12\x03Z\x02\x13\n\x0c\n\x05\x05\ + \0\x02\x03\x01\x12\x03Z\x02\x0e\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03Z\ + \x11\x12\n\x0b\n\x04\x05\0\x02\x04\x12\x03[\x02\x14\n\x0c\n\x05\x05\0\ + \x02\x04\x01\x12\x03[\x02\x0f\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03[\x12\ + \x13\n\n\n\x02\x04\x05\x12\x04^\0v\x01\n\n\n\x03\x04\x05\x01\x12\x03^\ + \x08\x1a\n\x0b\n\x04\x04\x05\x02\0\x12\x03_\x02\x15\n\x0c\n\x05\x04\x05\ + \x02\0\x05\x12\x03_\x02\x08\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03_\t\x10\ + \n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03_\x13\x14\n\x0b\n\x04\x04\x05\x02\ + \x01\x12\x03`\x02\x16\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\x03`\x02\x08\n\ + \x0c\n\x05\x04\x05\x02\x01\x01\x12\x03`\t\x11\n\x0c\n\x05\x04\x05\x02\ + \x01\x03\x12\x03`\x14\x15\n\x0b\n\x04\x04\x05\x02\x02\x12\x03a\x02\x16\n\ + \x0c\n\x05\x04\x05\x02\x02\x05\x12\x03a\x02\x08\n\x0c\n\x05\x04\x05\x02\ + \x02\x01\x12\x03a\t\x11\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03a\x14\x15\ + \n\x0b\n\x04\x04\x05\x02\x03\x12\x03b\x02\x17\n\x0c\n\x05\x04\x05\x02\ + \x03\x05\x12\x03b\x02\x08\n\x0c\n\x05\x04\x05\x02\x03\x01\x12\x03b\t\x12\ + \n\x0c\n\x05\x04\x05\x02\x03\x03\x12\x03b\x15\x16\n\x0b\n\x04\x04\x05\ + \x02\x04\x12\x03c\x02!\n\x0c\n\x05\x04\x05\x02\x04\x05\x12\x03c\x02\x07\ + \n\x0c\n\x05\x04\x05\x02\x04\x01\x12\x03c\x08\x1c\n\x0c\n\x05\x04\x05\ + \x02\x04\x03\x12\x03c\x1f\x20\n\x0c\n\x04\x04\x05\x02\x05\x12\x04d\x02i\ + \x04\n\x0c\n\x05\x04\x05\x02\x05\x05\x12\x03d\x02\x08\n\x0c\n\x05\x04\ + \x05\x02\x05\x01\x12\x03d\t\x12\n\x0c\n\x05\x04\x05\x02\x05\x03\x12\x03d\ + \x15\x16\n\r\n\x05\x04\x05\x02\x05\x08\x12\x04d\x17i\x03\n\x0f\n\x08\x04\ + \x05\x02\x05\x08\xee\xfb\x03\x12\x03e\x063\n\x0f\n\x08\x04\x05\x02\x05\ + \x08\xeb\xfb\x03\x12\x03f\x06G\n\x0f\n\x08\x04\x05\x02\x05\x08\xe9\xfb\ + \x03\x12\x03g\x06$\n\x0f\n\x08\x04\x05\x02\x05\x08\xed\xfb\x03\x12\x03h\ + \x06'\n\x0b\n\x04\x04\x05\x02\x06\x12\x03j\x02\x20\n\x0c\n\x05\x04\x05\ + \x02\x06\x06\x12\x03j\x02\x10\n\x0c\n\x05\x04\x05\x02\x06\x01\x12\x03j\ + \x11\x1b\n\x0c\n\x05\x04\x05\x02\x06\x03\x12\x03j\x1e\x1f\nL\n\x04\x04\ + \x05\x02\x07\x12\x04l\x02o/\x1a>\x20expirationTime\x20is\x20only\x20vali\ + d\x20iff\x20orderType\x20==\x20GOOD_TIL_TIME.\n\n\x0c\n\x05\x04\x05\x02\ + \x07\x06\x12\x03l\x02\x1b\n\x0c\n\x05\x04\x05\x02\x07\x01\x12\x03l\x1c+\ + \n\x0c\n\x05\x04\x05\x02\x07\x03\x12\x03l./\n\r\n\x05\x04\x05\x02\x07\ + \x08\x12\x04l0o.\n\x0f\n\x08\x04\x05\x02\x07\x08\xf2\xfb\x03\x12\x03m-G\ + \n\x0f\n\x08\x04\x05\x02\x07\x08\xe9\xfb\x03\x12\x03n-H\n\x0c\n\x04\x04\ + \x05\x02\x08\x12\x04p\x02u\x19\n\x0c\n\x05\x04\x05\x02\x08\x05\x12\x03p\ + \x02\x08\n\x0c\n\x05\x04\x05\x02\x08\x01\x12\x03p\t\x17\n\x0c\n\x05\x04\ + \x05\x02\x08\x03\x12\x03p\x1a\x1c\n\r\n\x05\x04\x05\x02\x08\x08\x12\x04p\ + \x1du\x18\n\x0f\n\x08\x04\x05\x02\x08\x08\xee\xfb\x03\x12\x03q\x17I\n\ + \x0f\n\x08\x04\x05\x02\x08\x08\xeb\xfb\x03\x12\x03r\x17X\n\x0f\n\x08\x04\ + \x05\x02\x08\x08\xe9\xfb\x03\x12\x03s\x174\n\x0f\n\x08\x04\x05\x02\x08\ + \x08\xed\xfb\x03\x12\x03t\x17=\n\x0b\n\x02\x04\x06\x12\x05x\0\x8b\x01\ + \x01\n\n\n\x03\x04\x06\x01\x12\x03x\x08\"\n\x0b\n\x04\x04\x06\x02\0\x12\ + \x03y\x02\x18\n\x0c\n\x05\x04\x06\x02\0\x05\x12\x03y\x02\x08\n\x0c\n\x05\ + \x04\x06\x02\0\x01\x12\x03y\t\x13\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03y\ + \x16\x17\n>\n\x04\x04\x06\x02\x01\x12\x05{\x02\x80\x01/\x1a/\x20Total\ + \x20amount\x20of\x20coin\x20used\x20for\x20the\x20limit\x20order\n\n\x0c\ + \n\x05\x04\x06\x02\x01\x06\x12\x03{\x02\x1a\n\x0c\n\x05\x04\x06\x02\x01\ + \x01\x12\x03{\x1b\"\n\x0c\n\x05\x04\x06\x02\x01\x03\x12\x03{%&\n\x0e\n\ + \x05\x04\x06\x02\x01\x08\x12\x05{'\x80\x01.\n\x0f\n\x08\x04\x06\x02\x01\ + \x08\xee\xfb\x03\x12\x03|'R\n\x0f\n\x08\x04\x06\x02\x01\x08\xe9\xfb\x03\ + \x12\x03}-I\n\x0f\n\x08\x04\x06\x02\x01\x08\xeb\xfb\x03\x12\x03~-o\n\x0f\ + \n\x08\x04\x06\x02\x01\x08\xed\xfb\x03\x12\x03\x7f-L\n\xaa\x02\n\x04\x04\ + \x06\x02\x02\x12\x06\x84\x01\x02\x89\x01*\x1a\x99\x02\x20Total\x20amount\ + \x20of\x20coin\x20received\x20from\x20the\x20taker\x20portion\x20of\x20t\ + he\x20limit\x20order\n\x20This\x20is\x20the\x20amount\x20of\x20coin\x20i\ + mmediately\x20available\x20in\x20the\x20users\x20account\x20after\x20exe\ + cuting\x20the\n\x20limit\x20order.\x20It\x20does\x20not\x20include\x20an\ + y\x20future\x20proceeds\x20from\x20the\x20maker\x20portion\x20which\x20w\ + ill\x20have\x20withdrawn\x20in\x20the\x20future\n\n\r\n\x05\x04\x06\x02\ + \x02\x06\x12\x04\x84\x01\x02\x1a\n\r\n\x05\x04\x06\x02\x02\x01\x12\x04\ + \x84\x01\x1b)\n\r\n\x05\x04\x06\x02\x02\x03\x12\x04\x84\x01,-\n\x0f\n\ + \x05\x04\x06\x02\x02\x08\x12\x06\x84\x01.\x89\x01)\n\x10\n\x08\x04\x06\ + \x02\x02\x08\xee\xfb\x03\x12\x04\x85\x01-_\n\x10\n\x08\x04\x06\x02\x02\ + \x08\xe9\xfb\x03\x12\x04\x86\x01(D\n\x10\n\x08\x04\x06\x02\x02\x08\xeb\ + \xfb\x03\x12\x04\x87\x01(j\n\x10\n\x08\x04\x06\x02\x02\x08\xed\xfb\x03\ + \x12\x04\x88\x01-S\n\x0c\n\x02\x04\x07\x12\x06\x8d\x01\0\x90\x01\x01\n\ + \x0b\n\x03\x04\x07\x01\x12\x04\x8d\x01\x08#\n\x0c\n\x04\x04\x07\x02\0\ + \x12\x04\x8e\x01\x02\x15\n\r\n\x05\x04\x07\x02\0\x05\x12\x04\x8e\x01\x02\ + \x08\n\r\n\x05\x04\x07\x02\0\x01\x12\x04\x8e\x01\t\x10\n\r\n\x05\x04\x07\ + \x02\0\x03\x12\x04\x8e\x01\x13\x14\n\x0c\n\x04\x04\x07\x02\x01\x12\x04\ + \x8f\x01\x02\x19\n\r\n\x05\x04\x07\x02\x01\x05\x12\x04\x8f\x01\x02\x08\n\ + \r\n\x05\x04\x07\x02\x01\x01\x12\x04\x8f\x01\t\x14\n\r\n\x05\x04\x07\x02\ + \x01\x03\x12\x04\x8f\x01\x17\x18\n\x0c\n\x02\x04\x08\x12\x06\x92\x01\0\ + \x93\x01\x01\n\x0b\n\x03\x04\x08\x01\x12\x04\x92\x01\x08+\n\x0c\n\x02\ + \x04\t\x12\x06\x95\x01\0\x98\x01\x01\n\x0b\n\x03\x04\t\x01\x12\x04\x95\ + \x01\x08\x1b\n\x0c\n\x04\x04\t\x02\0\x12\x04\x96\x01\x02\x15\n\r\n\x05\ + \x04\t\x02\0\x05\x12\x04\x96\x01\x02\x08\n\r\n\x05\x04\t\x02\0\x01\x12\ + \x04\x96\x01\t\x10\n\r\n\x05\x04\t\x02\0\x03\x12\x04\x96\x01\x13\x14\n\ + \x0c\n\x04\x04\t\x02\x01\x12\x04\x97\x01\x02\x19\n\r\n\x05\x04\t\x02\x01\ + \x05\x12\x04\x97\x01\x02\x08\n\r\n\x05\x04\t\x02\x01\x01\x12\x04\x97\x01\ + \t\x14\n\r\n\x05\x04\t\x02\x01\x03\x12\x04\x97\x01\x17\x18\n\x0c\n\x02\ + \x04\n\x12\x06\x9a\x01\0\x9b\x01\x01\n\x0b\n\x03\x04\n\x01\x12\x04\x9a\ + \x01\x08#\n\x0c\n\x02\x04\x0b\x12\x06\x9d\x01\0\x9f\x01\x01\n\x0b\n\x03\ + \x04\x0b\x01\x12\x04\x9d\x01\x08\x15\n\x0c\n\x04\x04\x0b\x02\0\x12\x04\ + \x9e\x01\x02\x1b\n\r\n\x05\x04\x0b\x02\0\x04\x12\x04\x9e\x01\x02\n\n\r\n\ + \x05\x04\x0b\x02\0\x05\x12\x04\x9e\x01\x0b\x11\n\r\n\x05\x04\x0b\x02\0\ + \x01\x12\x04\x9e\x01\x12\x16\n\r\n\x05\x04\x0b\x02\0\x03\x12\x04\x9e\x01\ + \x19\x1a\n\x0c\n\x02\x04\x0c\x12\x06\xa1\x01\0\xb4\x01\x01\n\x0b\n\x03\ + \x04\x0c\x01\x12\x04\xa1\x01\x08\x17\n\x0c\n\x04\x04\x0c\x02\0\x12\x04\ + \xa2\x01\x02\x15\n\r\n\x05\x04\x0c\x02\0\x05\x12\x04\xa2\x01\x02\x08\n\r\ + \n\x05\x04\x0c\x02\0\x01\x12\x04\xa2\x01\t\x10\n\r\n\x05\x04\x0c\x02\0\ + \x03\x12\x04\xa2\x01\x13\x14\n\x0c\n\x04\x04\x0c\x02\x01\x12\x04\xa3\x01\ + \x02\x16\n\r\n\x05\x04\x0c\x02\x01\x05\x12\x04\xa3\x01\x02\x08\n\r\n\x05\ + \x04\x0c\x02\x01\x01\x12\x04\xa3\x01\t\x11\n\r\n\x05\x04\x0c\x02\x01\x03\ + \x12\x04\xa3\x01\x14\x15\n\x0c\n\x04\x04\x0c\x02\x02\x12\x04\xa4\x01\x02\ + $\n\r\n\x05\x04\x0c\x02\x02\x04\x12\x04\xa4\x01\x02\n\n\r\n\x05\x04\x0c\ + \x02\x02\x06\x12\x04\xa4\x01\x0b\x18\n\r\n\x05\x04\x0c\x02\x02\x01\x12\ + \x04\xa4\x01\x19\x1f\n\r\n\x05\x04\x0c\x02\x02\x03\x12\x04\xa4\x01\"#\n\ + \x0e\n\x04\x04\x0c\x02\x03\x12\x06\xa5\x01\x02\xaa\x01\x19\n\r\n\x05\x04\ + \x0c\x02\x03\x05\x12\x04\xa5\x01\x02\x08\n\r\n\x05\x04\x0c\x02\x03\x01\ + \x12\x04\xa5\x01\t\x12\n\r\n\x05\x04\x0c\x02\x03\x03\x12\x04\xa5\x01\x15\ + \x16\n\x0f\n\x05\x04\x0c\x02\x03\x08\x12\x06\xa5\x01\x17\xaa\x01\x18\n\ + \x10\n\x08\x04\x0c\x02\x03\x08\xee\xfb\x03\x12\x04\xa6\x01\x17D\n\x10\n\ + \x08\x04\x0c\x02\x03\x08\xeb\xfb\x03\x12\x04\xa7\x01\x17X\n\x10\n\x08\ + \x04\x0c\x02\x03\x08\xe9\xfb\x03\x12\x04\xa8\x01\x175\n\x10\n\x08\x04\ + \x0c\x02\x03\x08\xed\xfb\x03\x12\x04\xa9\x01\x178\n\x0e\n\x04\x04\x0c\ + \x02\x04\x12\x06\xab\x01\x02\xb0\x01\x1f\n\r\n\x05\x04\x0c\x02\x04\x05\ + \x12\x04\xab\x01\x02\x08\n\r\n\x05\x04\x0c\x02\x04\x01\x12\x04\xab\x01\t\ + \x19\n\r\n\x05\x04\x0c\x02\x04\x03\x12\x04\xab\x01\x1c\x1d\n\x0f\n\x05\ + \x04\x0c\x02\x04\x08\x12\x06\xab\x01\x1e\xb0\x01\x1e\n\x10\n\x08\x04\x0c\ + \x02\x04\x08\xee\xfb\x03\x12\x04\xac\x01\x1dQ\n\x10\n\x08\x04\x0c\x02\ + \x04\x08\xeb\xfb\x03\x12\x04\xad\x01\x1di\n\x10\n\x08\x04\x0c\x02\x04\ + \x08\xe9\xfb\x03\x12\x04\xae\x01\x1d;\n\x10\n\x08\x04\x0c\x02\x04\x08\ + \xed\xfb\x03\x12\x04\xaf\x01\x1dE\n\x9c\x01\n\x04\x04\x0c\x02\x05\x12\ + \x04\xb3\x01\x02\x1b\x1a\x8d\x01\x20If\x20pickBestRoute\x20==\x20true\ + \x20then\x20all\x20routes\x20are\x20run\x20and\x20the\x20route\x20with\ + \x20the\x20best\x20price\x20is\x20chosen\n\x20otherwise,\x20the\x20first\ + \x20succesful\x20route\x20is\x20used.\n\n\r\n\x05\x04\x0c\x02\x05\x05\ + \x12\x04\xb3\x01\x02\x06\n\r\n\x05\x04\x0c\x02\x05\x01\x12\x04\xb3\x01\ + \x07\x16\n\r\n\x05\x04\x0c\x02\x05\x03\x12\x04\xb3\x01\x19\x1a\n\x0c\n\ + \x02\x04\r\x12\x06\xb6\x01\0\xbc\x01\x01\n\x0b\n\x03\x04\r\x01\x12\x04\ + \xb6\x01\x08\x1f\n\x0e\n\x04\x04\r\x02\0\x12\x06\xb7\x01\x02\xbb\x01*\n\ + \r\n\x05\x04\r\x02\0\x06\x12\x04\xb7\x01\x02\x1a\n\r\n\x05\x04\r\x02\0\ + \x01\x12\x04\xb7\x01\x1b#\n\r\n\x05\x04\r\x02\0\x03\x12\x04\xb7\x01&'\n\ + \x0f\n\x05\x04\r\x02\0\x08\x12\x06\xb7\x01(\xbb\x01)\n\x10\n\x08\x04\r\ + \x02\0\x08\xe9\xfb\x03\x12\x04\xb8\x01(D\n\x10\n\x08\x04\r\x02\0\x08\xeb\ + \xfb\x03\x12\x04\xb9\x01(j\n\x10\n\x08\x04\r\x02\0\x08\xed\xfb\x03\x12\ + \x04\xba\x01(H\n\x0c\n\x02\x04\x0e\x12\x06\xbe\x01\0\xc7\x01\x01\n\x0b\n\ + \x03\x04\x0e\x01\x12\x04\xbe\x01\x08\x17\n\x0b\n\x03\x04\x0e\x07\x12\x04\ + \xbf\x01\x02.\n\x0f\n\x07\x04\x0e\x07\xf1\x8c\xa6\x05\x12\x04\xbf\x01\ + \x02.\n\x0b\n\x03\x04\x0e\x07\x12\x04\xc0\x01\x02.\n\x10\n\x08\x04\x0e\ + \x07\xf0\x8c\xa6\x05\0\x12\x04\xc0\x01\x02.\nC\n\x04\x04\x0e\x02\0\x12\ + \x04\xc3\x01\x02J\x1a5\x20Authority\x20is\x20the\x20address\x20of\x20the\ + \x20governance\x20account.\n\n\r\n\x05\x04\x0e\x02\0\x05\x12\x04\xc3\x01\ + \x02\x08\n\r\n\x05\x04\x0e\x02\0\x01\x12\x04\xc3\x01\t\x12\n\r\n\x05\x04\ + \x0e\x02\0\x03\x12\x04\xc3\x01\x15\x16\n\r\n\x05\x04\x0e\x02\0\x08\x12\ + \x04\xc3\x01\x17I\n\x10\n\x08\x04\x0e\x02\0\x08\xca\xd6\x05\x12\x04\xc3\ + \x01\x19G\n8\n\x04\x04\x0e\x02\x01\x12\x06\xc5\x01\x02\xc6\x01D\x1a(\x20\ + NOTE:\x20All\x20parameters\x20must\x20be\x20supplied.\n\n\r\n\x05\x04\ + \x0e\x02\x01\x06\x12\x04\xc5\x01\x02\x08\n\r\n\x05\x04\x0e\x02\x01\x01\ + \x12\x04\xc5\x01\t\x0f\n\r\n\x05\x04\x0e\x02\x01\x03\x12\x04\xc5\x01\x12\ + \x13\n\r\n\x05\x04\x0e\x02\x01\x08\x12\x04\xc6\x01\x04C\n\x10\n\x08\x04\ + \x0e\x02\x01\x08\xe9\xfb\x03\x12\x04\xc6\x01\x06\"\n\x11\n\t\x04\x0e\x02\ + \x01\x08\xf5\x8c\xa6\x05\x12\x04\xc6\x01$A\n|\n\x02\x04\x0f\x12\x04\xcd\ + \x01\0\"\x1ap\x20MsgUpdateParamsResponse\x20defines\x20the\x20response\ + \x20structure\x20for\x20executing\x20a\n\x20MsgUpdateParams\x20message.\ + \n\n\x20Since:\x200.47\n\n\x0b\n\x03\x04\x0f\x01\x12\x04\xcd\x01\x08\x1f\ + b\x06proto3\ +"; + +/// `FileDescriptorProto` object which was a source for this generated file +fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); + file_descriptor_proto_lazy.get(|| { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() + }) +} + +/// `FileDescriptor` object which allows dynamic access to files +pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { + static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); + static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); + file_descriptor.get(|| { + let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { + let mut deps = ::std::vec::Vec::with_capacity(7); + deps.push(super::gogo::file_descriptor().clone()); + deps.push(super::coin::file_descriptor().clone()); + deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); + deps.push(super::amino::file_descriptor().clone()); + deps.push(super::params::file_descriptor().clone()); + deps.push(super::msg::file_descriptor().clone()); + deps.push(super::cosmos::file_descriptor().clone()); + let mut messages = ::std::vec::Vec::with_capacity(16); + messages.push(DepositOptions::generated_message_descriptor_data()); + messages.push(MsgDeposit::generated_message_descriptor_data()); + messages.push(MsgDepositResponse::generated_message_descriptor_data()); + messages.push(MsgWithdrawal::generated_message_descriptor_data()); + messages.push(MsgWithdrawalResponse::generated_message_descriptor_data()); + messages.push(MsgPlaceLimitOrder::generated_message_descriptor_data()); + messages.push(MsgPlaceLimitOrderResponse::generated_message_descriptor_data()); + messages.push(MsgWithdrawFilledLimitOrder::generated_message_descriptor_data()); + messages.push(MsgWithdrawFilledLimitOrderResponse::generated_message_descriptor_data()); + messages.push(MsgCancelLimitOrder::generated_message_descriptor_data()); + messages.push(MsgCancelLimitOrderResponse::generated_message_descriptor_data()); + messages.push(MultiHopRoute::generated_message_descriptor_data()); + messages.push(MsgMultiHopSwap::generated_message_descriptor_data()); + messages.push(MsgMultiHopSwapResponse::generated_message_descriptor_data()); + messages.push(MsgUpdateParams::generated_message_descriptor_data()); + messages.push(MsgUpdateParamsResponse::generated_message_descriptor_data()); + let mut enums = ::std::vec::Vec::with_capacity(1); + enums.push(LimitOrderType::generated_enum_descriptor_data()); + ::protobuf::reflect::GeneratedFileDescriptor::new_generated( + file_descriptor_proto(), + deps, + messages, + enums, + ) + }); + ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) + }) +} diff --git a/proto/amino.proto b/proto/amino.proto new file mode 100644 index 00000000..e1cc6929 --- /dev/null +++ b/proto/amino.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; +} diff --git a/proto/amino/amino.proto b/proto/amino/amino.proto new file mode 100644 index 00000000..e1cc6929 --- /dev/null +++ b/proto/amino/amino.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; +} diff --git a/proto/cosmos/app/runtime/v1alpha1/module.proto b/proto/cosmos/app/runtime/v1alpha1/module.proto new file mode 100644 index 00000000..4598ba44 --- /dev/null +++ b/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package cosmos.app.runtime.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the runtime module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/runtime" + use_package: {name: "cosmos.app.v1alpha1"} + }; + + // app_name is the name of the app. + string app_name = 1; + + // begin_blockers specifies the module names of begin blockers + // to call in the order in which they should be called. If this is left empty + // no begin blocker will be registered. + repeated string begin_blockers = 2; + + // end_blockers specifies the module names of the end blockers + // to call in the order in which they should be called. If this is left empty + // no end blocker will be registered. + repeated string end_blockers = 3; + + // init_genesis specifies the module names of init genesis functions + // to call in the order in which they should be called. If this is left empty + // no init genesis function will be registered. + repeated string init_genesis = 4; + + // export_genesis specifies the order in which to export module genesis data. + // If this is left empty, the init_genesis order will be used for export genesis + // if it is specified. + repeated string export_genesis = 5; + + // override_store_keys is an optional list of overrides for the module store keys + // to be used in keeper construction. + repeated StoreKeyConfig override_store_keys = 6; +} + +// StoreKeyConfig may be supplied to override the default module store key, which +// is the module name. +message StoreKeyConfig { + // name of the module to override the store key of + string module_name = 1; + + // the kv store key to use instead of the module name. + string kv_store_key = 2; +} diff --git a/proto/cosmos/app/v1alpha1/config.proto b/proto/cosmos/app/v1alpha1/config.proto new file mode 100644 index 00000000..ee3e7065 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/config.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/any.proto"; + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +message Config { + // modules are the module configurations for the app. + repeated ModuleConfig modules = 1; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + repeated GolangBinding golang_bindings = 2; +} + +// ModuleConfig is a module configuration for an app. +message ModuleConfig { + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // + // For example, for the module cosmos.bank.module.v1.Module, we may chose + // to simply name the module "bank" in the app. When we upgrade to + // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + // and the framework knows that the v2 module should receive all the same state + // that the v1 module had. Note: modules should provide info on which versions + // they can migrate from in the ModuleDescriptor.can_migration_from field. + string name = 1; + + // config is the config object for the module. Module config messages should + // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + google.protobuf.Any config = 2; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + repeated GolangBinding golang_bindings = 3; +} + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +message GolangBinding { + // interface_type is the interface type which will be bound to a specific implementation type + string interface_type = 1; + + // implementation is the implementing type which will be supplied when an input of type interface is requested + string implementation = 2; +} \ No newline at end of file diff --git a/proto/cosmos/app/v1alpha1/module.proto b/proto/cosmos/app/v1alpha1/module.proto new file mode 100644 index 00000000..99085717 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/module.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module indicates that this proto type is a config object for an app module + // and optionally provides other descriptive information about the module. + // It is recommended that a new module config object and go module is versioned + // for every state machine breaking version of a module. The recommended + // pattern for doing this is to put module config objects in a separate proto + // package from the API they expose. Ex: the cosmos.group.v1 API would be + // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. + ModuleDescriptor module = 57193479; +} + +// ModuleDescriptor describes an app module. +message ModuleDescriptor { + // go_import names the package that should be imported by an app to load the + // module in the runtime module registry. It is required to make debugging + // of configuration errors easier for users. + string go_import = 1; + + // use_package refers to a protobuf package that this module + // uses and exposes to the world. In an app, only one module should "use" + // or own a single protobuf package. It is assumed that the module uses + // all of the .proto files in a single package. + repeated PackageReference use_package = 2; + + // can_migrate_from defines which module versions this module can migrate + // state from. The framework will check that one module version is able to + // migrate from a previous module version before attempting to update its + // config. It is assumed that modules can transitively migrate from earlier + // versions. For instance if v3 declares it can migrate from v2, and v2 + // declares it can migrate from v1, the framework knows how to migrate + // from v1 to v3, assuming all 3 module versions are registered at runtime. + repeated MigrateFromInfo can_migrate_from = 3; +} + +// PackageReference is a reference to a protobuf package used by a module. +message PackageReference { + // name is the fully-qualified name of the package. + string name = 1; + + // revision is the optional revision of the package that is being used. + // Protobuf packages used in Cosmos should generally have a major version + // as the last part of the package name, ex. foo.bar.baz.v1. + // The revision of a package can be thought of as the minor version of a + // package which has additional backwards compatible definitions that weren't + // present in a previous version. + // + // A package should indicate its revision with a source code comment + // above the package declaration in one of its files containing the + // text "Revision N" where N is an integer revision. All packages start + // at revision 0 the first time they are released in a module. + // + // When a new version of a module is released and items are added to existing + // .proto files, these definitions should contain comments of the form + // "Since Revision N" where N is an integer revision. + // + // When the module runtime starts up, it will check the pinned proto + // image and panic if there are runtime protobuf definitions that are not + // in the pinned descriptor which do not have + // a "Since Revision N" comment or have a "Since Revision N" comment where + // N is <= to the revision specified here. This indicates that the protobuf + // files have been updated, but the pinned file descriptor hasn't. + // + // If there are items in the pinned file descriptor with a revision + // greater than the value indicated here, this will also cause a panic + // as it may mean that the pinned descriptor for a legacy module has been + // improperly updated or that there is some other versioning discrepancy. + // Runtime protobuf definitions will also be checked for compatibility + // with pinned file descriptors to make sure there are no incompatible changes. + // + // This behavior ensures that: + // * pinned proto images are up-to-date + // * protobuf files are carefully annotated with revision comments which + // are important good client UX + // * protobuf files are changed in backwards and forwards compatible ways + uint32 revision = 2; +} + +// MigrateFromInfo is information on a module version that a newer module +// can migrate from. +message MigrateFromInfo { + + // module is the fully-qualified protobuf name of the module config object + // for the previous module version, ex: "cosmos.group.module.v1.Module". + string module = 1; +} diff --git a/proto/cosmos/app/v1alpha1/query.proto b/proto/cosmos/app/v1alpha1/query.proto new file mode 100644 index 00000000..efec9c81 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "cosmos/app/v1alpha1/config.proto"; + +// Query is the app module query service. +service Query { + + // Config returns the current app config. + rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} +} + +// QueryConfigRequest is the Query/Config request type. +message QueryConfigRequest {} + +// QueryConfigRequest is the Query/Config response type. +message QueryConfigResponse { + + // config is the current app config. + Config config = 1; +} diff --git a/proto/cosmos/auth/module/v1/module.proto b/proto/cosmos/auth/module/v1/module.proto new file mode 100644 index 00000000..dbe46a15 --- /dev/null +++ b/proto/cosmos/auth/module/v1/module.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package cosmos.auth.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the auth module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth" + }; + + // bech32_prefix is the bech32 account prefix for the app. + string bech32_prefix = 1; + + // module_account_permissions are module account permissions. + repeated ModuleAccountPermission module_account_permissions = 2; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 3; +} + +// ModuleAccountPermission represents permissions for a module account. +message ModuleAccountPermission { + // account is the name of the module. + string account = 1; + + // permissions are the permissions this module has. Currently recognized + // values are minter, burner and staking. + repeated string permissions = 2; +} diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 00000000..0578453c --- /dev/null +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (amino.name) = "cosmos-sdk/BaseAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; + uint64 account_number = 3; + uint64 sequence = 4; +} + +// ModuleAccount defines an account for modules that holds coins on a pool. +message ModuleAccount { + option (amino.name) = "cosmos-sdk/ModuleAccount"; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; + + BaseAccount base_account = 1 [(gogoproto.embed) = true]; + string name = 2; + repeated string permissions = 3; +} + +// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +// +// Since: cosmos-sdk 0.47 +message ModuleCredential { + // module_name is the name of the module used for address derivation (passed into address.Module). + string module_name = 1; + // derivation_keys is for deriving a module account address (passed into address.Module) + // adding more keys creates sub-account addresses (passed into address.Derive) + repeated bytes derivation_keys = 2; +} + +// Params defines the parameters for the auth module. +message Params { + option (amino.name) = "cosmos-sdk/x/auth/Params"; + option (gogoproto.equal) = true; + + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; +} diff --git a/proto/cosmos/auth/v1beta1/genesis.proto b/proto/cosmos/auth/v1beta1/genesis.proto new file mode 100644 index 00000000..d1aa66e4 --- /dev/null +++ b/proto/cosmos/auth/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// GenesisState defines the auth module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // accounts are the accounts present at genesis. + repeated google.protobuf.Any accounts = 2; +} diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto new file mode 100644 index 00000000..804f2ff0 --- /dev/null +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,236 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Query defines the gRPC querier service. +service Query { + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.43 + rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + } + + // Account returns account details based on address. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } + + // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 + rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; + } + + // ModuleAccountByName returns the module account info by module name + rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + } + + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 + rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; + } + + // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 + rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; + } + + // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 + rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; + } + + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}"; + } +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryAccountsResponse { + // accounts are the existing accounts + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // account defines the account of the corresponding address. + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsRequest {} + +// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsResponse { + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + +// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameRequest { + string name = 1; +} + +// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameResponse { + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixRequest {} + +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixResponse { + string bech32_prefix = 1; +} + +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringRequest { + bytes address_bytes = 1; +} + +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringResponse { + string address_string = 1; +} + +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesRequest { + string address_string = 1; +} + +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesResponse { + bytes address_bytes = 1; +} + +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDRequest { + // Deprecated, use account_id instead + // + // id is the account number of the address to be queried. This field + // should have been an uint64 (like all account numbers), and will be + // updated to uint64 in a future version of the auth query. + int64 id = 1 [deprecated = true]; + + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 + uint64 account_id = 2; +} + +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDResponse { + string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoRequest is the Query/AccountInfo request type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoRequest { + + // address is the account address string. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoResponse is the Query/AccountInfo response type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoResponse { + + // info is the account info which is represented by BaseAccount. + BaseAccount info = 1; +} diff --git a/proto/cosmos/auth/v1beta1/tx.proto b/proto/cosmos/auth/v1beta1/tx.proto new file mode 100644 index 00000000..1edee037 --- /dev/null +++ b/proto/cosmos/auth/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Msg defines the x/auth Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/auth/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/auth parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/authz/module/v1/module.proto b/proto/cosmos/authz/module/v1/module.proto new file mode 100644 index 00000000..80058668 --- /dev/null +++ b/proto/cosmos/authz/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.authz.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the authz module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/authz" + }; +} diff --git a/proto/cosmos/authz/v1beta1/authz.proto b/proto/cosmos/authz/v1beta1/authz.proto new file mode 100644 index 00000000..3fee7364 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/authz.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// GenericAuthorization gives the grantee unrestricted permissions to execute +// the provided method on behalf of the granter's account. +message GenericAuthorization { + option (amino.name) = "cosmos-sdk/GenericAuthorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + + // Msg, identified by it's type URL, to grant unrestricted permissions to execute + string msg = 1; +} + +// Grant gives permissions to execute +// the provide method with expiration time. +message Grant { + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + // time when the grant will expire and will be pruned. If null, then the grant + // doesn't have a time expiration (other conditions in `authorization` + // may apply to invalidate the grant) + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; +} + +// GrantAuthorization extends a grant with both the addresses of the grantee and granter. +// It is used in genesis.proto and query.proto +message GrantAuthorization { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; +} + +// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +message GrantQueueItem { + // msg_type_urls contains the list of TypeURL of a sdk.Msg. + repeated string msg_type_urls = 1; +} diff --git a/proto/cosmos/authz/v1beta1/event.proto b/proto/cosmos/authz/v1beta1/event.proto new file mode 100644 index 00000000..0476649a --- /dev/null +++ b/proto/cosmos/authz/v1beta1/event.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// EventGrant is emitted on Msg/Grant +message EventGrant { + // Msg type URL for which an autorization is granted + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventRevoke is emitted on Msg/Revoke +message EventRevoke { + // Msg type URL for which an autorization is revoked + string msg_type_url = 2; + // Granter account address + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Grantee account address + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/proto/cosmos/authz/v1beta1/genesis.proto b/proto/cosmos/authz/v1beta1/genesis.proto new file mode 100644 index 00000000..9fefff45 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// GenesisState defines the authz module's genesis state. +message GenesisState { + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/authz/v1beta1/query.proto b/proto/cosmos/authz/v1beta1/query.proto new file mode 100644 index 00000000..62154ac1 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/query.proto @@ -0,0 +1,82 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// Query defines the gRPC querier service. +service Query { + // Returns list of `Authorization`, granted to the grantee by the granter. + rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; + } + + // GranterGrants returns list of `GrantAuthorization`, granted by granter. + // + // Since: cosmos-sdk 0.46 + rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; + } + + // GranteeGrants returns a list of `GrantAuthorization` by grantee. + // + // Since: cosmos-sdk 0.46 + rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; + } +} + +// QueryGrantsRequest is the request type for the Query/Grants RPC method. +message QueryGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Optional, msg_type_url, when set, will query only grants matching given msg type. + string msg_type_url = 3; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +message QueryGrantsResponse { + // authorizations is a list of grants granted for grantee by granter. + repeated Grant grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +message QueryGranterGrantsRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +message QueryGranterGrantsResponse { + // grants is a list of grants granted by the granter. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +message QueryGranteeGrantsRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +message QueryGranteeGrantsResponse { + // grants is a list of grants granted to the grantee. + repeated GrantAuthorization grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto new file mode 100644 index 00000000..69277c95 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -0,0 +1,81 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the authz Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + rpc Grant(MsgGrant) returns (MsgGrantResponse); + + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); +} + +// MsgGrant is a request type for Grant method. It declares authorization to the grantee +// on behalf of the granter with the provided expiration time. +message MsgGrant { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrant"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} + +// MsgExec attempts to execute the provided messages using +// authorizations granted to the grantee. Each message should have only +// one signer corresponding to the granter of the authorization. +message MsgExec { + option (cosmos.msg.v1.signer) = "grantee"; + option (amino.name) = "cosmos-sdk/MsgExec"; + + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Execute Msg. + // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + // triple and validate it. + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; +} + +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} + +// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +// granter's account with that has been granted to the grantee. +message MsgRevoke { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevoke"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string msg_type_url = 3; +} + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +message MsgRevokeResponse {} diff --git a/proto/cosmos/autocli/v1/options.proto b/proto/cosmos/autocli/v1/options.proto new file mode 100644 index 00000000..55877512 --- /dev/null +++ b/proto/cosmos/autocli/v1/options.proto @@ -0,0 +1,127 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// ModuleOptions describes the CLI options for a Cosmos SDK module. +message ModuleOptions { + // tx describes the tx command for the module. + ServiceCommandDescriptor tx = 1; + + // query describes the tx command for the module. + ServiceCommandDescriptor query = 2; +} + +// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +message ServiceCommandDescriptor { + + // service is the fully qualified name of the protobuf service to build + // the command from. It can be left empty if sub_commands are used instead + // which may be the case if a module provides multiple tx and/or query services. + string service = 1; + + // rpc_command_options are options for commands generated from rpc methods. + // If no options are specified for a given rpc method on the service, a + // command will be generated for that method with the default options. + repeated RpcCommandOptions rpc_command_options = 2; + + // sub_commands is a map of optional sub-commands for this command based on + // different protobuf services. The map key is used as the name of the + // sub-command. + map sub_commands = 3; +} + +// RpcCommandOptions specifies options for commands generated from protobuf +// rpc methods. +message RpcCommandOptions { + // rpc_method is short name of the protobuf rpc method that this command is + // generated from. + string rpc_method = 1; + + // use is the one-line usage method. It also allows specifying an alternate + // name for the command as the first word of the usage text. + // + // By default the name of an rpc command is the kebab-case short name of the + // rpc method. + string use = 2; + + // long is the long message shown in the 'help ' output. + string long = 3; + + // short is the short description shown in the 'help' output. + string short = 4; + + // example is examples of how to use the command. + string example = 5; + + // alias is an array of aliases that can be used instead of the first word in Use. + repeated string alias = 6; + + // suggest_for is an array of command names for which this command will be suggested - + // similar to aliases but only suggests. + repeated string suggest_for = 7; + + // deprecated defines, if this command is deprecated and should print this string when used. + string deprecated = 8; + + // version defines the version for this command. If this value is non-empty and the command does not + // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + // will print content of the "Version" variable. A shorthand "v" flag will also be added if the + // command does not define one. + string version = 9; + + // flag_options are options for flags generated from rpc request fields. + // By default all request fields are configured as flags. They can + // also be configured as positional args instead using positional_args. + map flag_options = 10; + + // positional_args specifies positional arguments for the command. + repeated PositionalArgDescriptor positional_args = 11; + + // skip specifies whether to skip this rpc method when generating commands. + bool skip = 12; +} + +// FlagOptions are options for flags generated from rpc request fields. +// By default, all request fields are configured as flags based on the +// kebab-case name of the field. Fields can be turned into positional arguments +// instead by using RpcCommandOptions.positional_args. +message FlagOptions { + + // name is an alternate name to use for the field flag. + string name = 1; + + // shorthand is a one-letter abbreviated flag. + string shorthand = 2; + + // usage is the help message. + string usage = 3; + + // default_value is the default value as text. + string default_value = 4; + + // default value is the default value as text if the flag is used without any value. + string no_opt_default_value = 5; + + // deprecated is the usage text to show if this flag is deprecated. + string deprecated = 6; + + // shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. + string shorthand_deprecated = 7; + + // hidden hides the flag from help/usage text + bool hidden = 8; +} + +// PositionalArgDescriptor describes a positional argument. +message PositionalArgDescriptor { + // proto_field specifies the proto field to use as the positional arg. Any + // fields used as positional args will not have a flag generated. + string proto_field = 1; + + // varargs makes a positional parameter a varargs parameter. This can only be + // applied to last positional parameter and the proto_field must a repeated + // field. + bool varargs = 2; +} diff --git a/proto/cosmos/autocli/v1/query.proto b/proto/cosmos/autocli/v1/query.proto new file mode 100644 index 00000000..a998978e --- /dev/null +++ b/proto/cosmos/autocli/v1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +import "cosmos/autocli/v1/options.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. +service Query { + // AppOptions returns the autocli options for all of the modules in an app. + rpc AppOptions(AppOptionsRequest) returns (AppOptionsResponse) { + // NOTE: autocli options SHOULD NOT be part of consensus and module_query_safe + // should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +message AppOptionsRequest {} + +// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +message AppOptionsResponse { + // module_options is a map of module name to autocli module options. + map module_options = 1; +} diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto new file mode 100644 index 00000000..51e3158b --- /dev/null +++ b/proto/cosmos/bank/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.bank.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the bank module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/bank" + }; + + // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. + // If left empty it defaults to the list of account names supplied in the auth module configuration as + // module_account_permissions + repeated string blocked_module_accounts_override = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/proto/cosmos/bank/v1beta1/authz.proto b/proto/cosmos/bank/v1beta1/authz.proto new file mode 100644 index 00000000..a8303536 --- /dev/null +++ b/proto/cosmos/bank/v1beta1/authz.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// SendAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account. +// +// Since: cosmos-sdk 0.43 +message SendAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/SendAuthorization"; + + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + // granter. If omitted, any recipient is allowed. + // + // Since: cosmos-sdk 0.47 + repeated string allow_list = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto new file mode 100644 index 00000000..f81bb923 --- /dev/null +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Params defines the parameters for the bank module. +message Params { + option (amino.name) = "cosmos-sdk/x/bank/Params"; + option (gogoproto.goproto_stringer) = false; + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + repeated SendEnabled send_enabled = 1 [deprecated = true]; + bool default_send_enabled = 2; +} + +// SendEnabled maps coin denom to a send_enabled status (whether a denom is +// sendable). +message SendEnabled { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + string denom = 1; + bool enabled = 2; +} + +// Input models transaction input. +message Input { + option (cosmos.msg.v1.signer) = "address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Output models transaction outputs. +message Output { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Supply represents a struct that passively keeps track of the total supply +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +message Supply { + option deprecated = true; + + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; + + repeated cosmos.base.v1beta1.Coin total = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// DenomUnit represents a struct that describes a given +// denomination unit of the basic token. +message DenomUnit { + // denom represents the string name of the given denom unit (e.g uatom). + string denom = 1; + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + uint32 exponent = 2; + // aliases is a list of string aliases for the given denom + repeated string aliases = 3; +} + +// Metadata represents a struct that describes +// a basic token. +message Metadata { + string description = 1; + // denom_units represents the list of DenomUnit's for a given coin + repeated DenomUnit denom_units = 2; + // base represents the base denom (should be the DenomUnit with exponent = 0). + string base = 3; + // display indicates the suggested denom that should be + // displayed in clients. + string display = 4; + // name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + string name = 5; + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + string symbol = 6; + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + string uri = 7 [(gogoproto.customname) = "URI"]; + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; +} diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto new file mode 100644 index 00000000..34214cfb --- /dev/null +++ b/proto/cosmos/bank/v1beta1/genesis.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// GenesisState defines the bank module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // balances is an array containing the balances of all the accounts. + repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + repeated cosmos.base.v1beta1.Coin supply = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // denom_metadata defines the metadata of the different coins. + repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 + repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Balance defines an account address and balance pair used in the bank module's +// genesis state. +message Balance { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the balance holder. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // coins defines the different coins this balance holds. + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto new file mode 100644 index 00000000..7abc31ba --- /dev/null +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -0,0 +1,348 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the balance of a single coin for a single account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; + } + + // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + } + + // SpendableBalances queries the spendable balance of all coins for a single + // account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + } + + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom"; + } + + // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + } + + // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; + } + + // Params queries the parameters of x/bank module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } + + // DenomsMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + } + + // DenomsMetadata queries the client metadata for all registered coin + // denominations. + rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } + + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +message QueryAllBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +// method. +message QueryAllBalancesResponse { + // balances is the balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpendableBalancesRequest defines the gRPC request structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +message QuerySpendableBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query spendable balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QuerySpendableBalancesResponse defines the gRPC response structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +message QuerySpendableBalancesResponse { + // balances is the spendable balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +// method. +message QueryTotalSupplyRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +message QueryTotalSupplyResponse { + // supply is the supply of the coins + repeated cosmos.base.v1beta1.Coin supply = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // pagination defines the pagination in the response. + // + // Since: cosmos-sdk 0.43 + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +message QuerySupplyOfRequest { + // denom is the coin denom to query balances for. + string denom = 1; +} + +// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +message QuerySupplyOfResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +message QueryDenomsMetadataRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +message QueryDenomsMetadataResponse { + // metadata provides the client information for all the registered tokens. + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +message QueryDenomMetadataRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +message QueryDenomMetadataResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryDenomOwnersRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +// +// Since: cosmos-sdk 0.46 +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +// +// Since: cosmos-sdk 0.46 +message QueryDenomOwnersResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledRequest { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + repeated string denoms = 1; + // pagination defines an optional pagination for the request. This field is + // only read if the denoms field is empty. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledResponse { + repeated SendEnabled send_enabled = 1; + // pagination defines the pagination in the response. This field is only + // populated if the denoms field in the request is empty. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto new file mode 100644 index 00000000..5d6926ef --- /dev/null +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Send defines a method for sending coins from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); + + // MultiSend defines a method for sending coins from some accounts to other accounts. + rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); +} + +// MsgSend represents a message to send coins from one account to another. +message MsgSend { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgSend"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} + +// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +message MsgMultiSend { + option (cosmos.msg.v1.signer) = "inputs"; + option (amino.name) = "cosmos-sdk/MsgMultiSend"; + + option (gogoproto.equal) = false; + + // Inputs, despite being `repeated`, only allows one sender input. This is + // checked in MsgMultiSend's ValidateBasic. + repeated Input inputs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Output outputs = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (amino.name) = "cosmos-sdk/x/bank/MsgUpdateParams"; + + // params defines the x/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabled { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // send_enabled is the list of entries to add or update. + repeated SendEnabled send_enabled = 2; + + // use_default_for is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + repeated string use_default_for = 3; +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabledResponse {} diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto new file mode 100644 index 00000000..ddaa6356 --- /dev/null +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -0,0 +1,158 @@ +syntax = "proto3"; +package cosmos.base.abci.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +message TxResponse { + option (gogoproto.goproto_getters) = false; + // The block height + int64 height = 1; + // The transaction hash. + string txhash = 2 [(gogoproto.customname) = "TxHash"]; + // Namespace for the Code + string codespace = 3; + // Response code. + uint32 code = 4; + // Result bytes, if any. + string data = 5; + // The output of the application's logger (raw string). May be + // non-deterministic. + string raw_log = 6; + // The output of the application's logger (typed). May be non-deterministic. + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; + // Additional information. May be non-deterministic. + string info = 8; + // Amount of gas requested for transaction. + int64 gas_wanted = 9; + // Amount of gas consumed by transaction. + int64 gas_used = 10; + // The request transaction bytes. + google.protobuf.Any tx = 11; + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + string timestamp = 12; + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; +} + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +message ABCIMessageLog { + option (gogoproto.stringer) = true; + + uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; + string log = 2; + + // Events contains a slice of Event objects that were emitted during some + // execution. + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +message StringEvent { + option (gogoproto.stringer) = true; + + string type = 1; + repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +message Attribute { + string key = 1; + string value = 2; +} + +// GasInfo defines tx execution gas context. +message GasInfo { + // GasWanted is the maximum units of work we allow this tx to perform. + uint64 gas_wanted = 1; + + // GasUsed is the amount of gas actually consumed. + uint64 gas_used = 2; +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +message Result { + option (gogoproto.goproto_getters) = false; + + // Data is any data returned from message or handler execution. It MUST be + // length prefixed in order to separate data from multiple message executions. + // Deprecated. This field is still populated, but prefer msg_response instead + // because it also contains the Msg response typeURL. + bytes data = 1 [deprecated = true]; + + // Log contains the log information from message or handler execution. + string log = 2; + + // Events contains a slice of Event objects that were emitted during message + // or handler execution. + repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; + + // msg_responses contains the Msg handler responses type packed in Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 4; +} + +// SimulationResponse defines the response generated when a transaction is +// successfully simulated. +message SimulationResponse { + GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Result result = 2; +} + +// MsgData defines the data returned in a Result object during message +// execution. +message MsgData { + option deprecated = true; + option (gogoproto.stringer) = true; + + string msg_type = 1; + bytes data = 2; +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +message TxMsgData { + option (gogoproto.stringer) = true; + + // data field is deprecated and not populated. + repeated MsgData data = 1 [deprecated = true]; + + // msg_responses contains the Msg handler responses packed into Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 2; +} + +// SearchTxsResult defines a structure for querying txs pageable +message SearchTxsResult { + option (gogoproto.stringer) = true; + + // Count of all txs + uint64 total_count = 1; + // Count of txs in current page + uint64 count = 2; + // Index of current page, start from 1 + uint64 page_number = 3; + // Count of total pages + uint64 page_total = 4; + // Max count txs per page + uint64 limit = 5; + // List of txs in current page + repeated TxResponse txs = 6; +} diff --git a/proto/cosmos/base/kv/v1beta1/kv.proto b/proto/cosmos/base/kv/v1beta1/kv.proto new file mode 100644 index 00000000..4e9b8d28 --- /dev/null +++ b/proto/cosmos/base/kv/v1beta1/kv.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.base.kv.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; + +// Pairs defines a repeated slice of Pair objects. +message Pairs { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; +} + +// Pair defines a key/value bytes tuple. +message Pair { + bytes key = 1; + bytes value = 2; +} diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto new file mode 100644 index 00000000..8070f7b9 --- /dev/null +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.base.node.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; + +// Service defines the gRPC querier service for node related queries. +service Service { + // Config queries for the operator configuration. + rpc Config(ConfigRequest) returns (ConfigResponse) { + option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; + } +} + +// ConfigRequest defines the request structure for the Config gRPC query. +message ConfigRequest {} + +// ConfigResponse defines the response structure for the Config gRPC query. +message ConfigResponse { + string minimum_gas_price = 1; +} diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 00000000..0a368144 --- /dev/null +++ b/proto/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package cosmos.base.query.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } +message PageRequest { + // key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + bytes key = 1; + + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + uint64 offset = 2; + + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 3; + + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + bool count_total = 4; + + // reverse is set to true if results are to be returned in the descending order. + // + // Since: cosmos-sdk 0.43 + bool reverse = 5; +} + +// PageResponse is to be embedded in gRPC response messages where the +// corresponding request message has used PageRequest. +// +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } +message PageResponse { + // next_key is the key to be passed to PageRequest.key to + // query the next page most efficiently. It will be empty if + // there are no more results. + bytes next_key = 1; + + // total is total number of results available if PageRequest.count_total + // was set, its value is undefined otherwise + uint64 total = 2; +} diff --git a/proto/cosmos/base/reflection/v1beta1/reflection.proto b/proto/cosmos/base/reflection/v1beta1/reflection.proto new file mode 100644 index 00000000..22670e72 --- /dev/null +++ b/proto/cosmos/base/reflection/v1beta1/reflection.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package cosmos.base.reflection.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; + +// ReflectionService defines a service for interface reflection. +service ReflectionService { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; + }; + + // ListImplementations list all the concrete types that implement a given + // interface. + rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" + "{interface_name}/implementations"; + }; +} + +// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +message ListAllInterfacesRequest {} + +// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +message ListAllInterfacesResponse { + // interface_names is an array of all the registered interfaces. + repeated string interface_names = 1; +} + +// ListImplementationsRequest is the request type of the ListImplementations +// RPC. +message ListImplementationsRequest { + // interface_name defines the interface to query the implementations for. + string interface_name = 1; +} + +// ListImplementationsResponse is the response type of the ListImplementations +// RPC. +message ListImplementationsResponse { + repeated string implementation_message_names = 1; +} diff --git a/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/proto/cosmos/base/reflection/v2alpha1/reflection.proto new file mode 100644 index 00000000..d5b04855 --- /dev/null +++ b/proto/cosmos/base/reflection/v2alpha1/reflection.proto @@ -0,0 +1,218 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.base.reflection.v2alpha1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; + +// AppDescriptor describes a cosmos-sdk based application +message AppDescriptor { + // AuthnDescriptor provides information on how to authenticate transactions on the application + // NOTE: experimental and subject to change in future releases. + AuthnDescriptor authn = 1; + // chain provides the chain descriptor + ChainDescriptor chain = 2; + // codec provides metadata information regarding codec related types + CodecDescriptor codec = 3; + // configuration provides metadata information regarding the sdk.Config type + ConfigurationDescriptor configuration = 4; + // query_services provides metadata information regarding the available queriable endpoints + QueryServicesDescriptor query_services = 5; + // tx provides metadata information regarding how to send transactions to the given application + TxDescriptor tx = 6; +} + +// TxDescriptor describes the accepted transaction type +message TxDescriptor { + // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + // it is not meant to support polymorphism of transaction types, it is supposed to be used by + // reflection clients to understand if they can handle a specific transaction type in an application. + string fullname = 1; + // msgs lists the accepted application messages (sdk.Msg) + repeated MsgDescriptor msgs = 2; +} + +// AuthnDescriptor provides information on how to sign transactions without relying +// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +message AuthnDescriptor { + // sign_modes defines the supported signature algorithm + repeated SigningModeDescriptor sign_modes = 1; +} + +// SigningModeDescriptor provides information on a signing flow of the application +// NOTE(fdymylja): here we could go as far as providing an entire flow on how +// to sign a message given a SigningModeDescriptor, but it's better to think about +// this another time +message SigningModeDescriptor { + // name defines the unique name of the signing mode + string name = 1; + // number is the unique int32 identifier for the sign_mode enum + int32 number = 2; + // authn_info_provider_method_fullname defines the fullname of the method to call to get + // the metadata required to authenticate using the provided sign_modes + string authn_info_provider_method_fullname = 3; +} + +// ChainDescriptor describes chain information of the application +message ChainDescriptor { + // id is the chain id + string id = 1; +} + +// CodecDescriptor describes the registered interfaces and provides metadata information on the types +message CodecDescriptor { + // interfaces is a list of the registerted interfaces descriptors + repeated InterfaceDescriptor interfaces = 1; +} + +// InterfaceDescriptor describes the implementation of an interface +message InterfaceDescriptor { + // fullname is the name of the interface + string fullname = 1; + // interface_accepting_messages contains information regarding the proto messages which contain the interface as + // google.protobuf.Any field + repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; + // interface_implementers is a list of the descriptors of the interface implementers + repeated InterfaceImplementerDescriptor interface_implementers = 3; +} + +// InterfaceImplementerDescriptor describes an interface implementer +message InterfaceImplementerDescriptor { + // fullname is the protobuf queryable name of the interface implementer + string fullname = 1; + // type_url defines the type URL used when marshalling the type as any + // this is required so we can provide type safe google.protobuf.Any marshalling and + // unmarshalling, making sure that we don't accept just 'any' type + // in our interface fields + string type_url = 2; +} + +// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains +// an interface represented as a google.protobuf.Any +message InterfaceAcceptingMessageDescriptor { + // fullname is the protobuf fullname of the type containing the interface + string fullname = 1; + // field_descriptor_names is a list of the protobuf name (not fullname) of the field + // which contains the interface as google.protobuf.Any (the interface is the same, but + // it can be in multiple fields of the same proto message) + repeated string field_descriptor_names = 2; +} + +// ConfigurationDescriptor contains metadata information on the sdk.Config +message ConfigurationDescriptor { + // bech32_account_address_prefix is the account address prefix + string bech32_account_address_prefix = 1; +} + +// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +message MsgDescriptor { + // msg_type_url contains the TypeURL of a sdk.Msg. + string msg_type_url = 1; +} + +// ReflectionService defines a service for application reflection. +service ReflectionService { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; + } + // GetChainDescriptor returns the description of the chain + rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; + }; + // GetCodecDescriptor returns the descriptor of the codec of the application + rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; + } + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; + } + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; + } + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; + } +} + +// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +message GetAuthnDescriptorRequest {} +// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +message GetAuthnDescriptorResponse { + // authn describes how to authenticate to the application when sending transactions + AuthnDescriptor authn = 1; +} + +// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +message GetChainDescriptorRequest {} +// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +message GetChainDescriptorResponse { + // chain describes application chain information + ChainDescriptor chain = 1; +} + +// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +message GetCodecDescriptorRequest {} +// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +message GetCodecDescriptorResponse { + // codec describes the application codec such as registered interfaces and implementations + CodecDescriptor codec = 1; +} + +// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorRequest {} +// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorResponse { + // config describes the application's sdk.Config + ConfigurationDescriptor config = 1; +} + +// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorRequest {} +// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorResponse { + // queries provides information on the available queryable services + QueryServicesDescriptor queries = 1; +} + +// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +message GetTxDescriptorRequest {} +// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +message GetTxDescriptorResponse { + // tx provides information on msgs that can be forwarded to the application + // alongside the accepted transaction protobuf type + TxDescriptor tx = 1; +} + +// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +message QueryServicesDescriptor { + // query_services is a list of cosmos-sdk QueryServiceDescriptor + repeated QueryServiceDescriptor query_services = 1; +} + +// QueryServiceDescriptor describes a cosmos-sdk queryable service +message QueryServiceDescriptor { + // fullname is the protobuf fullname of the service descriptor + string fullname = 1; + // is_module describes if this service is actually exposed by an application's module + bool is_module = 2; + // methods provides a list of query service methods + repeated QueryMethodDescriptor methods = 3; +} + +// QueryMethodDescriptor describes a queryable method of a query service +// no other info is provided beside method name and tendermint queryable path +// because it would be redundant with the grpc reflection service +message QueryMethodDescriptor { + // name is the protobuf name (not fullname) of the method + string name = 1; + // full_query_path is the path that can be used to query + // this method via tendermint abci.Query + string full_query_path = 2; +} diff --git a/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/proto/cosmos/base/snapshots/v1beta1/snapshot.proto new file mode 100644 index 00000000..e8f9c2e6 --- /dev/null +++ b/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package cosmos.base.snapshots.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; + +// Snapshot contains Tendermint state sync snapshot info. +message Snapshot { + uint64 height = 1; + uint32 format = 2; + uint32 chunks = 3; + bytes hash = 4; + Metadata metadata = 5 [(gogoproto.nullable) = false]; +} + +// Metadata contains SDK-specific snapshot metadata. +message Metadata { + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes +} + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +// +// Since: cosmos-sdk 0.46 +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; + SnapshotExtensionPayload extension_payload = 4; + SnapshotKVItem kv = 5 [deprecated = true, (gogoproto.customname) = "KV"]; + SnapshotSchema schema = 6 [deprecated = true]; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +// +// Since: cosmos-sdk 0.46 +message SnapshotStoreItem { + string name = 1; +} + +// SnapshotIAVLItem is an exported IAVL node. +// +// Since: cosmos-sdk 0.46 +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + // version is block height + int64 version = 3; + // height is depth of the tree. + int32 height = 4; +} + +// SnapshotExtensionMeta contains metadata about an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionMeta { + string name = 1; + uint32 format = 2; +} + +// SnapshotExtensionPayload contains payloads of an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionPayload { + bytes payload = 1; +} + +// SnapshotKVItem is an exported Key/Value Pair +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +message SnapshotKVItem { + option deprecated = true; + + bytes key = 1; + bytes value = 2; +} + +// SnapshotSchema is an exported schema of smt store +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +message SnapshotSchema { + option deprecated = true; + + repeated bytes keys = 1; +} \ No newline at end of file diff --git a/proto/cosmos/base/store/v1beta1/commit_info.proto b/proto/cosmos/base/store/v1beta1/commit_info.proto new file mode 100644 index 00000000..4625cdab --- /dev/null +++ b/proto/cosmos/base/store/v1beta1/commit_info.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +message CommitInfo { + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +message StoreInfo { + string name = 1; + CommitID commit_id = 2 [(gogoproto.nullable) = false]; +} + +// CommitID defines the commitment information when a specific store is +// committed. +message CommitID { + option (gogoproto.goproto_stringer) = false; + + int64 version = 1; + bytes hash = 2; +} diff --git a/proto/cosmos/base/store/v1beta1/listening.proto b/proto/cosmos/base/store/v1beta1/listening.proto new file mode 100644 index 00000000..753f7c16 --- /dev/null +++ b/proto/cosmos/base/store/v1beta1/listening.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "tendermint/abci/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +// +// Since: cosmos-sdk 0.43 +message StoreKVPair { + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; +} + +// BlockMetadata contains all the abci event data of a block +// the file streamer dump them into files together with the state changes. +message BlockMetadata { + // DeliverTx encapulate deliver tx request and response. + message DeliverTx { + tendermint.abci.RequestDeliverTx request = 1; + tendermint.abci.ResponseDeliverTx response = 2; + } + tendermint.abci.RequestBeginBlock request_begin_block = 1; + tendermint.abci.ResponseBeginBlock response_begin_block = 2; + repeated DeliverTx deliver_txs = 3; + tendermint.abci.RequestEndBlock request_end_block = 4; + tendermint.abci.ResponseEndBlock response_end_block = 5; + tendermint.abci.ResponseCommit response_commit = 6; +} diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto new file mode 100644 index 00000000..1f17b0a6 --- /dev/null +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -0,0 +1,208 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "tendermint/p2p/types.proto"; +import "tendermint/types/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/tendermint/v1beta1/types.proto"; +import "cosmos_proto/cosmos.proto"; +import "tendermint/types/block.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Service defines the gRPC querier service for tendermint queries. +service Service { + // GetNodeInfo queries the current node info. + rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; + } + + // GetSyncing queries node syncing. + rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; + } + + // GetLatestBlock returns the latest block. + rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; + } + + // GetBlockByHeight queries block for given height. + rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; + } + + // GetLatestValidatorSet queries latest validator-set. + rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; + } + + // GetValidatorSetByHeight queries validator-set at a given height. + rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; + } + + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/abci_query"; + } +} + +// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightRequest { + int64 height = 1; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetValidatorSetByHeightResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetRequest { + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +message GetLatestValidatorSetResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// Validator is the type for the validator-set. +message Validator { + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightRequest { + int64 height = 1; +} + +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +message GetBlockByHeightResponse { + .tendermint.types.BlockID block_id = 1; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; +} + +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +message GetLatestBlockRequest {} + +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +message GetLatestBlockResponse { + .tendermint.types.BlockID block_id = 1; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; +} + +// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +message GetSyncingRequest {} + +// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +message GetSyncingResponse { + bool syncing = 1; +} + +// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +message GetNodeInfoRequest {} + +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +message GetNodeInfoResponse { + .tendermint.p2p.DefaultNodeInfo default_node_info = 1; + VersionInfo application_version = 2; +} + +// VersionInfo is the type for the GetNodeInfoResponse message. +message VersionInfo { + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; + // Since: cosmos-sdk 0.43 + string cosmos_sdk_version = 8; +} + +// Module is the type for VersionInfo +message Module { + // module path + string path = 1; + // module version + string version = 2; + // checksum + string sum = 3; +} + +// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +message ABCIQueryRequest { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +// +// Note: This type is a duplicate of the ResponseQuery proto type defined in +// Tendermint. +message ABCIQueryResponse { + uint32 code = 1; + // DEPRECATED: use "value" instead + reserved 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +// ProofOp defines an operation used for calculating Merkle root. The data could +// be arbitrary format, providing necessary data for example neighbouring node +// hash. +// +// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps. +// +// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/base/tendermint/v1beta1/types.proto b/proto/cosmos/base/tendermint/v1beta1/types.proto new file mode 100644 index 00000000..6506997b --- /dev/null +++ b/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; +import "tendermint/version/types.proto"; +import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Block is tendermint type Block, with the Header proposer address +// field converted to bech32 string. +message Block { + Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Data data = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Commit last_commit = 4; +} + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // prev block info + .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + + // proposer_address is the original block proposer address, formatted as a Bech32 string. + // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + // for better UX. + string proposer_address = 14; // original proposer of the block +} diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto new file mode 100644 index 00000000..69c96f67 --- /dev/null +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/capability/module/v1/module.proto b/proto/cosmos/capability/module/v1/module.proto new file mode 100644 index 00000000..eabaadc1 --- /dev/null +++ b/proto/cosmos/capability/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package cosmos.capability.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the capability module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/capability" + }; + + // seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped + // keeper. For more details check x/capability/keeper.go. + bool seal_keeper = 1; +} \ No newline at end of file diff --git a/proto/cosmos/capability/v1beta1/capability.proto b/proto/cosmos/capability/v1beta1/capability.proto new file mode 100644 index 00000000..6f3595f1 --- /dev/null +++ b/proto/cosmos/capability/v1beta1/capability.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +message Capability { + option (gogoproto.goproto_stringer) = false; + + uint64 index = 1; +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +message Owner { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string module = 1; + string name = 2; +} + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +message CapabilityOwners { + repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/capability/v1beta1/genesis.proto b/proto/cosmos/capability/v1beta1/genesis.proto new file mode 100644 index 00000000..f119244e --- /dev/null +++ b/proto/cosmos/capability/v1beta1/genesis.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/capability/v1beta1/capability.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +// GenesisOwners defines the capability owners with their corresponding index. +message GenesisOwners { + // index is the index of the capability owner. + uint64 index = 1; + + // index_owners are the owners at the given index. + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// GenesisState defines the capability module's genesis state. +message GenesisState { + // index is the capability global index. + uint64 index = 1; + + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/consensus/module/v1/module.proto b/proto/cosmos/consensus/module/v1/module.proto new file mode 100644 index 00000000..8e188cc7 --- /dev/null +++ b/proto/cosmos/consensus/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.consensus.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the consensus module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/consensus" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/proto/cosmos/consensus/v1/query.proto b/proto/cosmos/consensus/v1/query.proto new file mode 100644 index 00000000..cdcb07ba --- /dev/null +++ b/proto/cosmos/consensus/v1/query.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "google/api/annotations.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/consensus_param module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/consensus/v1/params"; + } +} + +// QueryParamsRequest defines the request type for querying x/consensus parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/consensus parameters. +message QueryParamsResponse { + // params are the tendermint consensus params stored in the consensus module. + // Please note that `params.version` is not populated in this response, it is + // tracked separately in the x/upgrade module. + tendermint.types.ConsensusParams params = 1; +} diff --git a/proto/cosmos/consensus/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto new file mode 100644 index 00000000..0a7a3de0 --- /dev/null +++ b/proto/cosmos/consensus/v1/tx.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Msg defines the bank Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/consensus parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. + // + // NOTE: All parameters must be supplied. + tendermint.types.BlockParams block = 2; + tendermint.types.EvidenceParams evidence = 3; + tendermint.types.ValidatorParams validator = 4; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crisis/module/v1/module.proto b/proto/cosmos/crisis/module/v1/module.proto new file mode 100644 index 00000000..fe924962 --- /dev/null +++ b/proto/cosmos/crisis/module/v1/module.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package cosmos.crisis.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the crisis module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/crisis" + }; + + // fee_collector_name is the name of the FeeCollector ModuleAccount. + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto new file mode 100644 index 00000000..b0ddb9b6 --- /dev/null +++ b/proto/cosmos/crisis/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +// GenesisState defines the crisis module's genesis state. +message GenesisState { + // constant_fee is the fee used to verify the invariant in the crisis + // module. + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto new file mode 100644 index 00000000..4fcf5bf6 --- /dev/null +++ b/proto/cosmos/crisis/v1beta1/tx.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // VerifyInvariant defines a method to verify a particular invariant. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); + + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgVerifyInvariant represents a message to verify a particular invariance. +message MsgVerifyInvariant { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "cosmos-sdk/MsgVerifyInvariant"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // sender is the account address of private key to send coins to fee collector account. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // name of the invariant module. + string invariant_module_name = 2; + + // invariant_route is the msg's invariant route. + string invariant_route = 3; +} + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/crisis/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // constant_fee defines the x/crisis parameter. + cosmos.base.v1beta1.Coin constant_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crypto/ed25519/keys.proto b/proto/cosmos/crypto/ed25519/keys.proto new file mode 100644 index 00000000..728b5483 --- /dev/null +++ b/proto/cosmos/crypto/ed25519/keys.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.crypto.ed25519; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// ADR-28. Nevertheless, you will like to use ed25519 in app user level +// then you must create a new proto message and follow ADR-28 for Address construction. +message PubKey { + option (amino.name) = "tendermint/PubKeyEd25519"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; + option (gogoproto.goproto_stringer) = false; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} + +// Deprecated: PrivKey defines a ed25519 private key. +// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +message PrivKey { + option (amino.name) = "tendermint/PrivKeyEd25519"; + option (amino.message_encoding) = "key_field"; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; +} diff --git a/proto/cosmos/crypto/hd/v1/hd.proto b/proto/cosmos/crypto/hd/v1/hd.proto new file mode 100644 index 00000000..e25b70d1 --- /dev/null +++ b/proto/cosmos/crypto/hd/v1/hd.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.hd.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option (gogoproto.goproto_getters_all) = false; + +// BIP44Params is used as path field in ledger item in Record. +message BIP44Params { + option (amino.name) = "crypto/keys/hd/BIP44Params"; + + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; +} diff --git a/proto/cosmos/crypto/keyring/v1/record.proto b/proto/cosmos/crypto/keyring/v1/record.proto new file mode 100644 index 00000000..e79ea7f4 --- /dev/null +++ b/proto/cosmos/crypto/keyring/v1/record.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.keyring.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/crypto/hd/v1/hd.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.gogoproto_import) = false; + +// Record is used for representing a key in the keyring. +message Record { + // name represents a name of Record + string name = 1; + // pub_key represents a public key in any format + google.protobuf.Any pub_key = 2; + + // Record contains one of the following items + oneof item { + // local stores the private key locally. + Local local = 3; + // ledger stores the information about a Ledger key. + Ledger ledger = 4; + // Multi does not store any other information. + Multi multi = 5; + // Offline does not store any other information. + Offline offline = 6; + } + + // Item is a keyring item stored in a keyring backend. + // Local item + message Local { + google.protobuf.Any priv_key = 1; + } + + // Ledger item + message Ledger { + hd.v1.BIP44Params path = 1; + } + + // Multi item + message Multi {} + + // Offline item + message Offline {} +} diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto new file mode 100644 index 00000000..fa0dec57 --- /dev/null +++ b/proto/cosmos/crypto/multisig/keys.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.crypto.multisig; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; + +// LegacyAminoPubKey specifies a public key type +// which nests multiple public keys and a threshold, +// it uses legacy amino address rules. +message LegacyAminoPubKey { + option (amino.name) = "tendermint/PubKeyMultisigThreshold"; + // The Amino encoding of a LegacyAminoPubkey is the legacy amino + // encoding of the `PubKeyMultisigThreshold` struct defined below: + // https://github.com/tendermint/tendermint/blob/v0.33.9/crypto/multisig/threshold_pubkey.go + // + // There are 2 differences with what a "normal" Amino encoding + // would output: + // 1. The `threshold` field is always a string (whereas Amino would + // by default marshal uint32 as a number). + // 2. The `public_keys` field is renamed to `pubkeys`, which is also + // reflected in the `amino.field_name` annotation. + option (amino.message_encoding) = "threshold_string"; + option (gogoproto.goproto_getters) = false; + + uint32 threshold = 1; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (amino.field_name) = "pubkeys"]; +} diff --git a/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/proto/cosmos/crypto/multisig/v1beta1/multisig.proto new file mode 100644 index 00000000..bf671f17 --- /dev/null +++ b/proto/cosmos/crypto/multisig/v1beta1/multisig.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crypto.multisig.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +message MultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +message CompactBitArray { + option (gogoproto.goproto_stringer) = false; + + uint32 extra_bits_stored = 1; + bytes elems = 2; +} diff --git a/proto/cosmos/crypto/secp256k1/keys.proto b/proto/cosmos/crypto/secp256k1/keys.proto new file mode 100644 index 00000000..e2358d6d --- /dev/null +++ b/proto/cosmos/crypto/secp256k1/keys.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package cosmos.crypto.secp256k1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// the x-coordinate. Otherwise the first byte is a 0x03. +// This prefix is followed with the x-coordinate. +message PubKey { + option (amino.name) = "tendermint/PubKeySecp256k1"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; + option (gogoproto.goproto_stringer) = false; + + bytes key = 1; +} + +// PrivKey defines a secp256k1 private key. +message PrivKey { + option (amino.name) = "tendermint/PrivKeySecp256k1"; + option (amino.message_encoding) = "key_field"; + + bytes key = 1; +} diff --git a/proto/cosmos/crypto/secp256r1/keys.proto b/proto/cosmos/crypto/secp256r1/keys.proto new file mode 100644 index 00000000..2e96c6e3 --- /dev/null +++ b/proto/cosmos/crypto/secp256r1/keys.proto @@ -0,0 +1,23 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.crypto.secp256r1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a secp256r1 ECDSA public key. +message PubKey { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; +} + +// PrivKey defines a secp256r1 ECDSA private key. +message PrivKey { + // secret number serialized using big-endian encoding + bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; +} diff --git a/proto/cosmos/distribution/module/v1/module.proto b/proto/cosmos/distribution/module/v1/module.proto new file mode 100644 index 00000000..accf920c --- /dev/null +++ b/proto/cosmos/distribution/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.distribution.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the distribution module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/distribution" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto new file mode 100644 index 00000000..226003da --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// Params defines the set of params for the distribution module. +message Params { + option (amino.name) = "cosmos-sdk/x/distribution/Params"; + option (gogoproto.goproto_stringer) = false; + + string community_tax = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Deprecated: The base_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + string base_proposer_reward = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + deprecated = true + ]; + + // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + string bonus_proposer_reward = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + deprecated = true + ]; + + bool withdraw_addr_enabled = 4; +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message ValidatorHistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + uint32 reference_count = 2; +} + +// ValidatorCurrentRewards represents current rewards and current +// period for a validator kept as a running counter and incremented +// each block as long as the validator's tokens remain constant. +message ValidatorCurrentRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + uint64 period = 2; +} + +// ValidatorAccumulatedCommission represents accumulated commission +// for a validator kept as a running counter, can be withdrawn at any time. +message ValidatorAccumulatedCommission { + repeated cosmos.base.v1beta1.DecCoin commission = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +// for a validator inexpensive to track, allows simple sanity checks. +message ValidatorOutstandingRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// This is needed to calculate appropriate amount of staking tokens +// for delegations which are withdrawn after a slash has occurred. +message ValidatorSlashEvent { + uint64 validator_period = 1; + string fraction = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +message ValidatorSlashEvents { + option (gogoproto.goproto_stringer) = false; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// FeePool is the global fee pool for distribution. +message FeePool { + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// CommunityPoolSpendProposal details a proposal for use of community funds, +// together with how many coins are proposed to be spent, and to which +// recipient account. +// +// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +// longer a need for an explicit CommunityPoolSpendProposal. To spend community +// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +// module via a v1 governance proposal. +message CommunityPoolSpendProposal { + option deprecated = true; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + repeated cosmos.base.v1beta1.Coin amount = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// the delegators within the validator may be left with less than a full token, +// thus sdk.Dec is used. +message DelegatorStartingInfo { + uint64 previous_period = 1; + string stake = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 height = 3 + [(gogoproto.jsontag) = "creation_height", (amino.field_name) = "creation_height", (amino.dont_omitempty) = true]; +} + +// DelegationDelegatorReward represents the properties +// of a delegator's delegation reward. +message DelegationDelegatorReward { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + repeated cosmos.base.v1beta1.DecCoin reward = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +message CommunityPoolSpendProposalWithDeposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + string amount = 4; + string deposit = 5; +} diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto new file mode 100644 index 00000000..5bf2d6bb --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/genesis.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// DelegatorWithdrawInfo is the address for where distributions rewards are +// withdrawn to by default this struct is only used at genesis to feed in +// default withdraw addresses. +message DelegatorWithdrawInfo { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // withdraw_address is the address to withdraw the delegation rewards to. + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +message ValidatorOutstandingRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // outstanding_rewards represents the outstanding rewards of a validator. + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +// json. +message ValidatorAccumulatedCommissionRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // accumulated is the accumulated commission of a validator. + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorHistoricalRewardsRecord is used for import / export via genesis +// json. +message ValidatorHistoricalRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // period defines the period the historical rewards apply to. + uint64 period = 2; + + // rewards defines the historical rewards of a validator. + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +message ValidatorCurrentRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // rewards defines the current rewards of a validator. + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DelegatorStartingInfoRecord used for import / export via genesis json. +message DelegatorStartingInfoRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_address is the address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // starting_info defines the starting info of a delegator. + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorSlashEventRecord is used for import / export via genesis json. +message ValidatorSlashEventRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // height defines the block height at which the slash event occurred. + uint64 height = 2; + // period is the period of the slash event. + uint64 period = 3; + // validator_slash_event describes the slash event. + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// GenesisState defines the distribution module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the fee pool at genesis. + FeePool fee_pool = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the delegator withdraw infos at genesis. + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the previous proposer at genesis. + string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // fee_pool defines the outstanding rewards of all validators at genesis. + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the accumulated commissions of all validators at genesis. + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the historical rewards of all validators at genesis. + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the current rewards of all validators at genesis. + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the delegator starting infos at genesis. + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // fee_pool defines the validator slash events at genesis. + repeated ValidatorSlashEventRecord validator_slash_events = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/distribution/v1beta1/query.proto b/proto/cosmos/distribution/v1beta1/query.proto new file mode 100644 index 00000000..4788467d --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/query.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; + +// Query defines the gRPC querier service for distribution module. +service Query { + // Params queries params of the distribution module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; + } + + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + rpc ValidatorDistributionInfo(QueryValidatorDistributionInfoRequest) + returns (QueryValidatorDistributionInfoResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}"; + } + + // ValidatorOutstandingRewards queries rewards of a validator address. + rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) + returns (QueryValidatorOutstandingRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/outstanding_rewards"; + } + + // ValidatorCommission queries accumulated commission for a validator. + rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/commission"; + } + + // ValidatorSlashes queries slash events of a validator. + rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; + } + + // DelegationRewards queries the total rewards accrued by a delegation. + rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" + "{validator_address}"; + } + + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; + } + + // DelegatorValidators queries the validators of a delegator. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/validators"; + } + + // DelegatorWithdrawAddress queries withdraw address of a delegator. + rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/withdraw_address"; + } + + // CommunityPool queries the community pool coins. + rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoResponse { + // operator_address defines the validator operator address. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // self_bond_rewards defines the self delegations rewards. + repeated cosmos.base.v1beta1.DecCoin self_bond_rewards = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + // commission defines the commission the validator received. + repeated cosmos.base.v1beta1.DecCoin commission = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// QueryValidatorOutstandingRewardsRequest is the request type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorOutstandingRewardsResponse is the response type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsResponse { + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorCommissionRequest is the request type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorCommissionResponse is the response type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionResponse { + // commission defines the commission the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorSlashesRequest is the request type for the +// Query/ValidatorSlashes RPC method +message QueryValidatorSlashesRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // starting_height defines the optional starting height to query the slashes. + uint64 starting_height = 2; + // starting_height defines the optional ending height to query the slashes. + uint64 ending_height = 3; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryValidatorSlashesResponse is the response type for the +// Query/ValidatorSlashes RPC method. +message QueryValidatorSlashesResponse { + // slashes defines the slashes the validator received. + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRewardsRequest is the request type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address defines the validator address to query for. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationRewardsResponse is the response type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsResponse { + // rewards defines the rewards accrued by a delegation. + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// QueryDelegationTotalRewardsRequest is the request type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationTotalRewardsResponse is the response type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsResponse { + // rewards defines all the rewards accrued by a delegator. + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // total defines the sum of all the rewards. + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} + +// QueryDelegatorValidatorsRequest is the request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorsResponse is the response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validators defines the validators a delegator is delegating for. + repeated string validators = 1; +} + +// QueryDelegatorWithdrawAddressRequest is the request type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorWithdrawAddressResponse is the response type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // withdraw_address defines the delegator address to query for. + string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +message QueryCommunityPoolRequest {} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +message QueryCommunityPoolResponse { + // pool defines community pool's coins. + repeated cosmos.base.v1beta1.DecCoin pool = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto new file mode 100644 index 00000000..957747cf --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -0,0 +1,178 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; + +// Msg defines the distribution Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); + + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); +} + +// MsgSetWithdrawAddress sets the withdraw address for +// a delegator (or validator self-delegation). +message MsgSetWithdrawAddress { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgModifyWithdrawAddress"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +// type. +message MsgSetWithdrawAddressResponse {} + +// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +// from a single validator. +message MsgWithdrawDelegatorReward { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawDelegationReward"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +// response type. +message MsgWithdrawDelegatorRewardResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgWithdrawValidatorCommission withdraws the full commission to the validator +// address. +message MsgWithdrawValidatorCommission { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawValCommission"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawValidatorCommissionResponse defines the +// Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +message MsgFundCommunityPool { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgFundCommunityPool"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distribution/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/distribution parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgCommunityPoolSpend defines a message for sending tokens from the community +// pool to another account. This message is typically executed via a governance +// proposal with the governance module being the executing authority. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpend { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpendResponse {} diff --git a/proto/cosmos/evidence/module/v1/module.proto b/proto/cosmos/evidence/module/v1/module.proto new file mode 100644 index 00000000..fceea7da --- /dev/null +++ b/proto/cosmos/evidence/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.evidence.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the evidence module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/evidence" + }; +} \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/evidence.proto b/proto/cosmos/evidence/v1beta1/evidence.proto new file mode 100644 index 00000000..8dca3201 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/evidence.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +message Equivocation { + option (amino.name) = "cosmos-sdk/Equivocation"; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // height is the equivocation height. + int64 height = 1; + + // time is the equivocation time. + google.protobuf.Timestamp time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // power is the equivocation validator power. + int64 power = 3; + + // consensus_address is the equivocation validator consensus address. + string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/genesis.proto b/proto/cosmos/evidence/v1beta1/genesis.proto new file mode 100644 index 00000000..199f446f --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +import "google/protobuf/any.proto"; + +// GenesisState defines the evidence module's genesis state. +message GenesisState { + // evidence defines all the evidence at genesis. + repeated google.protobuf.Any evidence = 1; +} diff --git a/proto/cosmos/evidence/v1beta1/query.proto b/proto/cosmos/evidence/v1beta1/query.proto new file mode 100644 index 00000000..34163dd5 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/query.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +// Query defines the gRPC querier service. +service Query { + // Evidence queries evidence based on evidence hash. + rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{hash}"; + } + + // AllEvidence queries all evidence. + rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; + } +} + +// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +message QueryEvidenceRequest { + // evidence_hash defines the hash of the requested evidence. + // Deprecated: Use hash, a HEX encoded string, instead. + bytes evidence_hash = 1 + [deprecated = true, (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + + // hash defines the evidence hash of the requested evidence. + // + // Since: cosmos-sdk 0.47 + string hash = 2; +} + +// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +message QueryEvidenceResponse { + // evidence returns the requested evidence. + google.protobuf.Any evidence = 1; +} + +// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceResponse { + // evidence returns all evidences. + repeated google.protobuf.Any evidence = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto new file mode 100644 index 00000000..f5646e2d --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg defines the evidence Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +message MsgSubmitEvidence { + option (cosmos.msg.v1.signer) = "submitter"; + option (amino.name) = "cosmos-sdk/MsgSubmitEvidence"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // submitter is the signer account address of evidence. + string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // evidence defines the evidence of misbehavior. + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"]; +} + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/proto/cosmos/feegrant/module/v1/module.proto b/proto/cosmos/feegrant/module/v1/module.proto new file mode 100644 index 00000000..d838f02f --- /dev/null +++ b/proto/cosmos/feegrant/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.feegrant.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the feegrant module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/feegrant" + }; +} \ No newline at end of file diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto new file mode 100644 index 00000000..1cfe741b --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -0,0 +1,93 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// BasicAllowance implements Allowance with a one-time grant of coins +// that optionally expires. The grantee can use up to SpendLimit to cover fees. +message BasicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/BasicAllowance"; + + // spend_limit specifies the maximum amount of coins that can be spent + // by this allowance and will be updated as coins are spent. If it is + // empty, there is no spend limit and any amount of coins can be spent. + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // expiration specifies an optional time when this allowance expires + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; +} + +// PeriodicAllowance extends Allowance to allow for both a maximum cap, +// as well as a limit per time period. +message PeriodicAllowance { + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/PeriodicAllowance"; + + // basic specifies a struct of `BasicAllowance` + BasicAllowance basic = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + google.protobuf.Duration period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // period_can_spend is the number of coins left to be spent before the period_reset time + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // period_reset is the time at which this period resets and a new one begins, + // it is calculated from the start time of the first transaction after the + // last period ended + google.protobuf.Timestamp period_reset = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// AllowedMsgAllowance creates allowance only for specified message types. +message AllowedMsgAllowance { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/AllowedMsgAllowance"; + + // allowance can be any of basic and periodic fee allowance. + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; + + // allowed_messages are the messages for which the grantee has the access. + repeated string allowed_messages = 2; +} + +// Grant is stored in the KVStore to record a grant with full context +message Grant { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; +} diff --git a/proto/cosmos/feegrant/v1beta1/genesis.proto b/proto/cosmos/feegrant/v1beta1/genesis.proto new file mode 100644 index 00000000..a1ead956 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// GenesisState contains a set of fee allowances, persisted from the store +message GenesisState { + repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto new file mode 100644 index 00000000..baef7770 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/query.proto @@ -0,0 +1,84 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Query defines the gRPC querier service. +service Query { + + // Allowance returns fee granted to the grantee by the granter. + rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; + } + + // Allowances returns all the grants for address. + rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; + } + + // AllowancesByGranter returns all the grants given by an address + // + // Since: cosmos-sdk 0.46 + rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; + } +} + +// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +message QueryAllowanceRequest { + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +message QueryAllowanceResponse { + // allowance is a allowance granted for grantee by granter. + cosmos.feegrant.v1beta1.Grant allowance = 1; +} + +// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +message QueryAllowancesRequest { + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +message QueryAllowancesResponse { + // allowances are allowance's granted for grantee by granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryAllowancesByGranterRequest { + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryAllowancesByGranterResponse { + // allowances that have been issued by the granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 00000000..20bbaf48 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,57 @@ +// Since: cosmos-sdk 0.43 +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Msg defines the feegrant msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); + + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); +} + +// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +message MsgGrantAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrantAllowance"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; +} + +// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +message MsgGrantAllowanceResponse {} + +// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +message MsgRevokeAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevokeAllowance"; + + // granter is the address of the user granting an allowance of their funds. + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +message MsgRevokeAllowanceResponse {} diff --git a/proto/cosmos/genutil/module/v1/module.proto b/proto/cosmos/genutil/module/v1/module.proto new file mode 100644 index 00000000..86e6f576 --- /dev/null +++ b/proto/cosmos/genutil/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.genutil.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the genutil module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/genutil" + }; +} \ No newline at end of file diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto new file mode 100644 index 00000000..45aa6bb2 --- /dev/null +++ b/proto/cosmos/genutil/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.genutil.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; + +// GenesisState defines the raw genesis transaction in JSON. +message GenesisState { + // gen_txs defines the genesis transactions. + repeated bytes gen_txs = 1 [ + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs", + (amino.field_name) = "gentxs", + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/cosmos/gov/module/v1/module.proto b/proto/cosmos/gov/module/v1/module.proto new file mode 100644 index 00000000..9544cfe2 --- /dev/null +++ b/proto/cosmos/gov/module/v1/module.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package cosmos.gov.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the gov module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/gov" + }; + + // max_metadata_len defines the maximum proposal metadata length. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto new file mode 100644 index 00000000..b9cf573f --- /dev/null +++ b/proto/cosmos/gov/v1/genesis.proto @@ -0,0 +1,33 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.gov.v1; + +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2; + // votes defines all the votes present at genesis. + repeated Vote votes = 3; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 8; +} diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto new file mode 100644 index 00000000..49bfcc26 --- /dev/null +++ b/proto/cosmos/gov/v1/gov.proto @@ -0,0 +1,220 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. + VoteOption option = 1; + + // weight is the vote weight associated with the vote option. + string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + // id defines the unique id of the proposal. + uint64 id = 1; + + // messages are the arbitrary messages to be executed if the proposal passes. + repeated google.protobuf.Any messages = 2; + + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 10; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 11; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 12; + + // Proposer is the address of the proposal sumbitter + // + // Since: cosmos-sdk 0.47 + string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + // yes_count is the number of yes votes on a proposal. + string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + // abstain_count is the number of abstain votes on a proposal. + string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_count is the number of no votes on a proposal. + string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_with_veto_count is the number of no with veto votes on a proposal. + string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + reserved 3; + + // options is the weighted vote options. + repeated WeightedVoteOption options = 4; + + // metadata is any arbitrary metadata to attached to the vote. + string metadata = 5; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +message Params { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; + + // Duration of the voting period. + google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // burn deposits if a proposal does not meet quorum + bool burn_vote_quorum = 13; + + // burn deposits if the proposal does not enter voting period + bool burn_proposal_deposit_prevote = 14; + + // burn deposits if quorum with vote type no_veto is met + bool burn_vote_veto = 15; +} diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto new file mode 100644 index 00000000..0c1c9f2b --- /dev/null +++ b/proto/cosmos/gov/v1/query.proto @@ -0,0 +1,193 @@ + +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + // proposal is the requested governance proposal. + Proposal proposal = 1; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defines the queried vote. + Vote vote = 1; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defines the queried votes. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // Deprecated: Prefer to use `params` instead. + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 4; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + // deposits defines the requested deposits. + repeated Deposit deposits = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1; +} diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto new file mode 100644 index 00000000..1708066c --- /dev/null +++ b/proto/cosmos/gov/v1/tx.proto @@ -0,0 +1,172 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1/gov.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Msg defines the gov Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given the messages. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal"; + + // messages are the arbitrary messages to be executed if proposal passes. + repeated google.protobuf.Any messages = 1; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 4; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 5; + + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 6; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +message MsgExecLegacyContent { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/v1/MsgExecLegacyContent"; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // authority must be the gov module address. + string authority = 2; +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +message MsgExecLegacyContentResponse {} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVote"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the Vote. + string metadata = 4; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3; + + // metadata is any arbitrary metadata attached to the VoteWeighted. + string metadata = 4; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/v1/MsgDeposit"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto new file mode 100644 index 00000000..a680590c --- /dev/null +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cosmos.gov.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2 + [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // votes defines all the votes present at genesis. + repeated Vote votes = 3 + [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4 + [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // params defines all the parameters of related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 00000000..dc8fcfd3 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,252 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 +message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. + VoteOption option = 1; + + // weight is the vote weight associated with the vote option. + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +message TextProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/TextProposal"; + + option (gogoproto.equal) = true; + + // title of the proposal. + string title = 1; + + // description associated with the proposal. + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // content is the proposal's content. + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + // yes is the number of yes votes on a proposal. + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // abstain is the number of abstain votes on a proposal. + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // no is the number of no votes on a proposal. + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // no_with_veto is the number of no with veto votes on a proposal. + string no_with_veto = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true]; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + VoteOption option = 3 [deprecated = true]; + + // options is the weighted vote options. + // + // Since: cosmos-sdk 0.43 + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty" + ]; +} diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto new file mode 100644 index 00000000..f225a0f6 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defines the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defines the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + // deposits defines the requested deposits. + repeated Deposit deposits = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 00000000..0afa1d56 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/MsgSubmitProposal"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVote"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVoteWeighted"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgDeposit"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/proto/cosmos/group/module/v1/module.proto b/proto/cosmos/group/module/v1/module.proto new file mode 100644 index 00000000..d1e7ffb2 --- /dev/null +++ b/proto/cosmos/group/module/v1/module.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package cosmos.group.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "amino/amino.proto"; + +// Module is the config object of the group module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/group" + }; + + // max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + // to execute the proposal. + google.protobuf.Duration max_execution_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + // Defaults to 255 if not explicitly set. + uint64 max_metadata_len = 2; +} diff --git a/proto/cosmos/group/v1/events.proto b/proto/cosmos/group/v1/events.proto new file mode 100644 index 00000000..2b98ec9a --- /dev/null +++ b/proto/cosmos/group/v1/events.proto @@ -0,0 +1,94 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/group/v1/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// EventCreateGroup is an event emitted when a group is created. +message EventCreateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventUpdateGroup is an event emitted when a group is updated. +message EventUpdateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventCreateGroupPolicy is an event emitted when a group policy is created. +message EventCreateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +message EventUpdateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventSubmitProposal is an event emitted when a proposal is created. +message EventSubmitProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +message EventWithdrawProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventVote is an event emitted when a voter votes on a proposal. +message EventVote { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventExec is an event emitted when a proposal is executed. +message EventExec { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // result is the proposal execution result. + ProposalExecutorResult result = 2; + + // logs contains error logs in case the execution result is FAILURE. + string logs = 3; +} + +// EventLeaveGroup is an event emitted when group member leaves the group. +message EventLeaveGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // address is the account address of the group member. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventProposalPruned is an event emitted when a proposal is pruned. +message EventProposalPruned { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + ProposalStatus status = 2; + + // tally_result is the proposal tally result (when applicable). + TallyResult tally_result = 3; +} diff --git a/proto/cosmos/group/v1/genesis.proto b/proto/cosmos/group/v1/genesis.proto new file mode 100644 index 00000000..e4c895e9 --- /dev/null +++ b/proto/cosmos/group/v1/genesis.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "cosmos/group/v1/types.proto"; + +// GenesisState defines the group module's genesis state. +message GenesisState { + + // group_seq is the group table orm.Sequence, + // it is used to get the next group ID. + uint64 group_seq = 1; + + // groups is the list of groups info. + repeated GroupInfo groups = 2; + + // group_members is the list of groups members. + repeated GroupMember group_members = 3; + + // group_policy_seq is the group policy table orm.Sequence, + // it is used to generate the next group policy account address. + uint64 group_policy_seq = 4; + + // group_policies is the list of group policies info. + repeated GroupPolicyInfo group_policies = 5; + + // proposal_seq is the proposal table orm.Sequence, + // it is used to get the next proposal ID. + uint64 proposal_seq = 6; + + // proposals is the list of proposals. + repeated Proposal proposals = 7; + + // votes is the list of votes. + repeated Vote votes = 8; +} \ No newline at end of file diff --git a/proto/cosmos/group/v1/query.proto b/proto/cosmos/group/v1/query.proto new file mode 100644 index 00000000..80b09255 --- /dev/null +++ b/proto/cosmos/group/v1/query.proto @@ -0,0 +1,320 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// Query is the cosmos.group.v1 Query service. +service Query { + + // GroupInfo queries group info based on group id. + rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}"; + }; + + // GroupPolicyInfo queries group policy info based on account address of group policy. + rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; + }; + + // GroupMembers queries members of a group by group id. + rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; + }; + + // GroupsByAdmin queries groups by admin address. + rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}"; + }; + + // GroupPoliciesByGroup queries group policies by group id. + rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; + }; + + // GroupPoliciesByAdmin queries group policies by admin address. + rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; + }; + + // Proposal queries a proposal based on proposal id. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}"; + }; + + // ProposalsByGroupPolicy queries proposals based on account address of group policy. + rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}"; + }; + + // VoteByProposalVoter queries a vote by proposal id and voter. + rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; + }; + + // VotesByProposal queries a vote by proposal id. + rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; + }; + + // VotesByVoter queries a vote by voter. + rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}"; + }; + + // GroupsByMember queries groups by member address. + rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; + }; + + // TallyResult returns the tally result of a proposal. If the proposal is + // still in voting period, then this query computes the current tally state, + // which might not be final. On the other hand, if the proposal is final, + // then it simply returns the `final_tally_result` state stored in the + // proposal itself. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; + }; + + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups"; + }; +} + +// QueryGroupInfoRequest is the Query/GroupInfo request type. +message QueryGroupInfoRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// QueryGroupInfoResponse is the Query/GroupInfo response type. +message QueryGroupInfoResponse { + // info is the GroupInfo of the group. + GroupInfo info = 1; +} + +// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +message QueryGroupPolicyInfoRequest { + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +message QueryGroupPolicyInfoResponse { + // info is the GroupPolicyInfo of the group policy. + GroupPolicyInfo info = 1; +} + +// QueryGroupMembersRequest is the Query/GroupMembers request type. +message QueryGroupMembersRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +message QueryGroupMembersResponse { + // members are the members of the group with given group_id. + repeated GroupMember members = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +message QueryGroupsByAdminRequest { + // admin is the account address of a group's admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +message QueryGroupsByAdminResponse { + // groups are the groups info with the provided admin. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +message QueryGroupPoliciesByGroupRequest { + // group_id is the unique ID of the group policy's group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +message QueryGroupPoliciesByGroupResponse { + // group_policies are the group policies info associated with the provided group. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +message QueryGroupPoliciesByAdminRequest { + // admin is the admin address of the group policy. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +message QueryGroupPoliciesByAdminResponse { + // group_policies are the group policies info with provided admin. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryProposalRequest is the Query/Proposal request type. +message QueryProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the Query/Proposal response type. +message QueryProposalResponse { + // proposal is the proposal info. + Proposal proposal = 1; +} + +// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +message QueryProposalsByGroupPolicyRequest { + // address is the account address of the group policy related to proposals. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +message QueryProposalsByGroupPolicyResponse { + // proposals are the proposals with given group policy. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +message QueryVoteByProposalVoterRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // voter is a proposal voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +message QueryVoteByProposalVoterResponse { + // vote is the vote with given proposal_id and voter. + Vote vote = 1; +} + +// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +message QueryVotesByProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +message QueryVotesByProposalResponse { + // votes are the list of votes for given proposal_id. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +message QueryVotesByVoterRequest { + // voter is a proposal voter account address. + string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +message QueryVotesByVoterResponse { + // votes are the list of votes by given voter. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +message QueryGroupsByMemberRequest { + // address is the group member address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +message QueryGroupsByMemberResponse { + // groups are the groups info with the provided group member. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the Query/TallyResult request type. +message QueryTallyResultRequest { + // proposal_id is the unique id of a proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the Query/TallyResult response type. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsRequest { + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsResponse { + // `groups` is all the groups present in state. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/group/v1/tx.proto b/proto/cosmos/group/v1/tx.proto new file mode 100644 index 00000000..20e04cb7 --- /dev/null +++ b/proto/cosmos/group/v1/tx.proto @@ -0,0 +1,394 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg is the cosmos.group.v1 Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. + rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); + + // UpdateGroupMembers updates the group members with given group id and admin address. + rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse); + + // UpdateGroupAdmin updates the group admin with given group id and previous admin address. + rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse); + + // UpdateGroupMetadata updates the group metadata with given group id and admin address. + rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse); + + // CreateGroupPolicy creates a new group policy using given DecisionPolicy. + rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse); + + // CreateGroupWithPolicy creates a new group with policy. + rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse); + + // UpdateGroupPolicyAdmin updates a group policy admin. + rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse); + + // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. + rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy) + returns (MsgUpdateGroupPolicyDecisionPolicyResponse); + + // UpdateGroupPolicyMetadata updates a group policy metadata. + rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse); + + // SubmitProposal submits a new proposal. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // WithdrawProposal withdraws a proposal. + rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); + + // Vote allows a voter to vote on a proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Exec executes a proposal. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // LeaveGroup allows a group member to leave the group. + rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse); +} + +// +// Groups +// + +// MsgCreateGroup is the Msg/CreateGroup request type. +message MsgCreateGroup { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroup"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; +} + +// MsgCreateGroupResponse is the Msg/CreateGroup response type. +message MsgCreateGroupResponse { + // group_id is the unique ID of the newly created group. + uint64 group_id = 1; +} + +// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +message MsgUpdateGroupMembers { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMembers"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // member_updates is the list of members to update, + // set weight to 0 to remove a member. + repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +message MsgUpdateGroupMembersResponse {} + +// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +message MsgUpdateGroupAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupAdmin"; + + // admin is the current account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // new_admin is the group new admin account address. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +message MsgUpdateGroupAdminResponse {} + +// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +message MsgUpdateGroupMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is the updated group's metadata. + string metadata = 3; +} + +// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +message MsgUpdateGroupMetadataResponse {} + +// +// Group Policies +// + +// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +message MsgCreateGroupPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is any arbitrary metadata attached to the group policy. + string metadata = 3; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +message MsgCreateGroupPolicyResponse { + // address is the account address of the newly created group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +message MsgUpdateGroupPolicyAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of the group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // new_admin is the new group policy admin. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +message MsgUpdateGroupPolicyAdminResponse {} + +// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +message MsgCreateGroupWithPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupWithPolicy"; + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group and group policy admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // group_metadata is any arbitrary metadata attached to the group. + string group_metadata = 3; + + // group_policy_metadata is any arbitrary metadata attached to the group policy. + string group_policy_metadata = 4; + + // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + // and group policy admin. + bool group_policy_as_admin = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +message MsgCreateGroupWithPolicyResponse { + // group_id is the unique ID of the newly created group with policy. + uint64 group_id = 1; + + // group_policy_address is the account address of the newly created group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +message MsgUpdateGroupPolicyDecisionPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decision_policy is the updated group policy's decision policy. + google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +message MsgUpdateGroupPolicyDecisionPolicyResponse {} + +// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +message MsgUpdateGroupPolicyMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is the group policy metadata to be updated. + string metadata = 3; +} + +// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +message MsgUpdateGroupPolicyMetadataResponse {} + +// +// Proposals and Voting +// + +// Exec defines modes of execution of a proposal on creation or on new vote. +enum Exec { + // An empty value means that there should be a separate + // MsgExec request for the proposal to execute. + EXEC_UNSPECIFIED = 0; + + // Try to execute the proposal immediately. + // If the proposal is not allowed per the DecisionPolicy, + // the proposal will still be open and could + // be executed at a later point. + EXEC_TRY = 1; +} + +// MsgSubmitProposal is the Msg/SubmitProposal request type. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposers"; + option (amino.name) = "cosmos-sdk/group/MsgSubmitProposal"; + + option (gogoproto.goproto_getters) = false; + + // group_policy_address is the account address of group policy. + string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // proposers are the account addresses of the proposers. + // Proposers signatures will be counted as yes votes. + repeated string proposers = 2; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 3; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 4; + + // exec defines the mode of execution of the proposal, + // whether it should be executed immediately on creation or not. + // If so, proposers signatures are considered as Yes votes. + Exec exec = 5; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 6; + + // summary is the summary of the proposal. + // + // Since: cosmos-sdk 0.47 + string summary = 7; +} + +// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +message MsgWithdrawProposal { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgWithdrawProposal"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // address is the admin of the group policy or one of the proposer of the proposal. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +message MsgWithdrawProposalResponse {} + +// MsgVote is the Msg/Vote request type. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/group/MsgVote"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + string metadata = 4; + + // exec defines whether the proposal should be executed + // immediately after voting or not. + Exec exec = 5; +} + +// MsgVoteResponse is the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgExec is the Msg/Exec request type. +message MsgExec { + option (cosmos.msg.v1.signer) = "signer"; + option (amino.name) = "cosmos-sdk/group/MsgExec"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // executor is the account address used to execute the proposal. + string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgExecResponse is the Msg/Exec request type. +message MsgExecResponse { + // result is the final result of the proposal execution. + ProposalExecutorResult result = 2; +} + +// MsgLeaveGroup is the Msg/LeaveGroup request type. +message MsgLeaveGroup { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgLeaveGroup"; + + // address is the account address of the group member. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; +} + +// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +message MsgLeaveGroupResponse {} diff --git a/proto/cosmos/group/v1/types.proto b/proto/cosmos/group/v1/types.proto new file mode 100644 index 00000000..4968d13c --- /dev/null +++ b/proto/cosmos/group/v1/types.proto @@ -0,0 +1,337 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "amino/amino.proto"; + +// Member represents a group member with an account address, +// non-zero weight, metadata and added_at timestamp. +message Member { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; + + // added_at is a timestamp specifying when a member was added. + google.protobuf.Timestamp added_at = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MemberRequest represents a group member to be used in Msg server requests. +// Contrary to `Member`, it doesn't have any `added_at` field +// since this field cannot be set as part of requests. +message MemberRequest { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; +} + +// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +// satisfies the two following conditions: +// 1. The sum of all `YES` voter's weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message ThresholdDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/ThresholdDecisionPolicy"; + + // threshold is the minimum weighted sum of `YES` votes that must be met or + // exceeded for a proposal to succeed. + string threshold = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// PercentageDecisionPolicy is a decision policy where a proposal passes when +// it satisfies the two following conditions: +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message PercentageDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/PercentageDecisionPolicy"; + + // percentage is the minimum percentage of the weighted sum of `YES` votes must + // meet for a proposal to succeed. + string percentage = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// DecisionPolicyWindows defines the different windows for voting and execution. +message DecisionPolicyWindows { + // voting_period is the duration from submission of a proposal to the end of voting period + // Within this times votes can be submitted with MsgVote. + google.protobuf.Duration voting_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // min_execution_period is the minimum duration after the proposal submission + // where members can start sending MsgExec. This means that the window for + // sending a MsgExec transaction is: + // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + // where max_execution_period is a app-specific config, defined in the keeper. + // If not set, min_execution_period will default to 0. + // + // Please make sure to set a `min_execution_period` that is smaller than + // `voting_period + max_execution_period`, or else the above execution window + // is empty, meaning that all proposals created with this decision policy + // won't be able to be executed. + google.protobuf.Duration min_execution_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// VoteOption enumerates the valid vote options for a given proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + // return an error. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// +// State +// + +// GroupInfo represents the high-level on-chain information for a group. +message GroupInfo { + // id is the unique ID of the group. + uint64 id = 1; + + // admin is the account address of the group's admin. + string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; + + // version is used to track changes to a group's membership structure that + // would break existing proposals. Whenever any members weight is changed, + // or any member is added or removed this version is incremented and will + // cause proposals based on older versions of this group to fail + uint64 version = 4; + + // total_weight is the sum of the group members' weights. + string total_weight = 5; + + // created_at is a timestamp specifying when a group was created. + google.protobuf.Timestamp created_at = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// GroupMember represents the relationship between a group and a member. +message GroupMember { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // member is the member data. + Member member = 2; +} + +// GroupPolicyInfo represents the high-level on-chain information for a group policy. +message GroupPolicyInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + // address is the account address of group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // admin is the account address of the group admin. + string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the group policy. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + string metadata = 4; + + // version is used to track changes to a group's GroupPolicyInfo structure that + // would create a different result on a running proposal. + uint64 version = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; + + // created_at is a timestamp specifying when a group policy was created. + google.protobuf.Timestamp created_at = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Proposal defines a group proposal. Any member of a group can submit a proposal +// for a group policy to decide upon. +// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +// passes as well as some optional metadata associated with the proposal. +message Proposal { + option (gogoproto.goproto_getters) = false; + + // id is the unique id of the proposal. + uint64 id = 1; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#proposal-4 + string metadata = 3; + + // proposers are the account addresses of the proposers. + repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // submit_time is a timestamp specifying when a proposal was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // group_version tracks the version of the group at proposal submission. + // This field is here for informational purposes only. + uint64 group_version = 6; + + // group_policy_version tracks the version of the group policy at proposal submission. + // When a decision policy is changed, existing proposals from previous policy + // versions will become invalid with the `ABORTED` status. + // This field is here for informational purposes only. + uint64 group_policy_version = 7; + + // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + ProposalStatus status = 8; + + // final_tally_result contains the sums of all weighted votes for this + // proposal for each vote option. It is empty at submission, and only + // populated after tallying, at voting period end or at proposal execution, + // whichever happens first. + TallyResult final_tally_result = 9 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_period_end is the timestamp before which voting must be done. + // Unless a successful MsgExec is called before (to execute a proposal whose + // tally is successful before the voting period ends), tallying will be done + // at this point, and the `final_tally_result`and `status` fields will be + // accordingly updated. + google.protobuf.Timestamp voting_period_end = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // executor_result is the final result of the proposal execution. Initial value is NotRun. + ProposalExecutorResult executor_result = 11; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 12; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 13; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 14; +} + +// ProposalStatus defines proposal statuses. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is invalid and not allowed. + PROPOSAL_STATUS_UNSPECIFIED = 0; + + // Initial status of a proposal when submitted. + PROPOSAL_STATUS_SUBMITTED = 1; + + // Final status of a proposal when the final tally is done and the outcome + // passes the group policy's decision policy. + PROPOSAL_STATUS_ACCEPTED = 2; + + // Final status of a proposal when the final tally is done and the outcome + // is rejected by the group policy's decision policy. + PROPOSAL_STATUS_REJECTED = 3; + + // Final status of a proposal when the group policy is modified before the + // final tally. + PROPOSAL_STATUS_ABORTED = 4; + + // A proposal can be withdrawn before the voting start time by the owner. + // When this happens the final status is Withdrawn. + PROPOSAL_STATUS_WITHDRAWN = 5; +} + +// ProposalExecutorResult defines types of proposal executor results. +enum ProposalExecutorResult { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is not allowed. + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0; + + // We have not yet run the executor. + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1; + + // The executor was successful and proposed action updated state. + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2; + + // The executor returned an error and proposed action didn't update state. + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3; +} + +// TallyResult represents the sum of weighted votes for each vote option. +message TallyResult { + option (gogoproto.goproto_getters) = false; + + // yes_count is the weighted sum of yes votes. + string yes_count = 1; + + // abstain_count is the weighted sum of abstainers. + string abstain_count = 2; + + // no_count is the weighted sum of no votes. + string no_count = 3; + + // no_with_veto_count is the weighted sum of veto. + string no_with_veto_count = 4; +} + +// Vote represents a vote for a proposal. +message Vote { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the account address of the voter. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + string metadata = 4; + + // submit_time is the timestamp when the vote was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} diff --git a/proto/cosmos/mint/module/v1/module.proto b/proto/cosmos/mint/module/v1/module.proto new file mode 100644 index 00000000..2ea1ef3d --- /dev/null +++ b/proto/cosmos/mint/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.mint.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the mint module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/mint" + }; + + string fee_collector_name = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} \ No newline at end of file diff --git a/proto/cosmos/mint/v1beta1/genesis.proto b/proto/cosmos/mint/v1beta1/genesis.proto new file mode 100644 index 00000000..b6cc1504 --- /dev/null +++ b/proto/cosmos/mint/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // minter is a space for holding current inflation information. + Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto new file mode 100644 index 00000000..49b00a5d --- /dev/null +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// Minter represents the minting state. +message Minter { + // current annual inflation rate + string inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // current annual expected provisions + string annual_provisions = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Params defines the parameters for the x/mint module. +message Params { + option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/mint/Params"; + + // type of coin to mint + string mint_denom = 1; + // maximum annual change in inflation rate + string inflation_rate_change = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // maximum inflation rate + string inflation_max = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // minimum inflation rate + string inflation_min = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // goal of percent bonded atoms + string goal_bonded = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // expected blocks per year + uint64 blocks_per_year = 6; +} diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto new file mode 100644 index 00000000..002f2744 --- /dev/null +++ b/proto/cosmos/mint/v1beta1/query.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + } + + // Inflation returns the current minting inflation value. + rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; + } + + // AnnualProvisions current minting annual provisions value. + rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +message QueryInflationRequest {} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +message QueryInflationResponse { + // inflation is the current minting inflation value. + bytes inflation = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// QueryAnnualProvisionsRequest is the request type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsRequest {} + +// QueryAnnualProvisionsResponse is the response type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsResponse { + // annual_provisions is the current minting annual provisions value. + bytes annual_provisions = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/cosmos/mint/v1beta1/tx.proto b/proto/cosmos/mint/v1beta1/tx.proto new file mode 100644 index 00000000..ec71fb73 --- /dev/null +++ b/proto/cosmos/mint/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the x/mint Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/mint/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/msg/v1/msg.proto b/proto/cosmos/msg/v1/msg.proto new file mode 100644 index 00000000..853efa1f --- /dev/null +++ b/proto/cosmos/msg/v1/msg.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cosmos.msg.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; + +extend google.protobuf.ServiceOptions { + // service indicates that the service is a Msg service and that requests + // must be transported via blockchain transactions rather than gRPC. + // Tooling can use this annotation to distinguish between Msg services and + // other types of services via reflection. + bool service = 11110000; +} + +extend google.protobuf.MessageOptions { + // signer must be used in cosmos messages in order + // to signal to external clients which fields in a + // given cosmos message must be filled with signer + // information (address). + // The field must be the protobuf name of the message + // field extended with this MessageOption. + // The field must either be of string kind, or of message + // kind in case the signer information is contained within + // a message inside the cosmos message. + repeated string signer = 11110000; +} diff --git a/proto/cosmos/nft/module/v1/module.proto b/proto/cosmos/nft/module/v1/module.proto new file mode 100644 index 00000000..8f820fa0 --- /dev/null +++ b/proto/cosmos/nft/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.nft.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the nft module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/nft" + }; +} \ No newline at end of file diff --git a/proto/cosmos/nft/v1beta1/event.proto b/proto/cosmos/nft/v1beta1/event.proto new file mode 100644 index 00000000..2f6d5a0d --- /dev/null +++ b/proto/cosmos/nft/v1beta1/event.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// EventSend is emitted on Msg/Send +message EventSend { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3; + + // receiver is the receiver address of nft + string receiver = 4; +} + +// EventMint is emitted on Mint +message EventMint { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} + +// EventBurn is emitted on Burn +message EventBurn { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} diff --git a/proto/cosmos/nft/v1beta1/genesis.proto b/proto/cosmos/nft/v1beta1/genesis.proto new file mode 100644 index 00000000..75b5245a --- /dev/null +++ b/proto/cosmos/nft/v1beta1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // entry defines all nft owned by a person. + repeated Entry entries = 2; +} + +// Entry Defines all nft owned by a person +message Entry { + // owner is the owner address of the following nft + string owner = 1; + + // nfts is a group of nfts of the same owner + repeated cosmos.nft.v1beta1.NFT nfts = 2; +} diff --git a/proto/cosmos/nft/v1beta1/nft.proto b/proto/cosmos/nft/v1beta1/nft.proto new file mode 100644 index 00000000..b1241260 --- /dev/null +++ b/proto/cosmos/nft/v1beta1/nft.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Class defines the class of the nft type. +message Class { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + string id = 1; + + // name defines the human-readable name of the NFT classification. Optional + string name = 2; + + // symbol is an abbreviated name for nft classification. Optional + string symbol = 3; + + // description is a brief description of nft classification. Optional + string description = 4; + + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + string uri = 5; + + // uri_hash is a hash of the document pointed by uri. Optional + string uri_hash = 6; + + // data is the app specific metadata of the NFT class. Optional + google.protobuf.Any data = 7; +} + +// NFT defines the NFT. +message NFT { + // class_id associated with the NFT, similar to the contract address of ERC721 + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; + + // uri for the NFT metadata stored off chain + string uri = 3; + + // uri_hash is a hash of the document pointed by uri + string uri_hash = 4; + + // data is an app specific data of the NFT. Optional + google.protobuf.Any data = 10; +} diff --git a/proto/cosmos/nft/v1beta1/query.proto b/proto/cosmos/nft/v1beta1/query.proto new file mode 100644 index 00000000..ae482e4c --- /dev/null +++ b/proto/cosmos/nft/v1beta1/query.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}"; + } + + // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}"; + } + + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}"; + } + + // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + // ERC721Enumerable + rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts"; + } + + // NFT queries an NFT based on its class and id. + rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}"; + } + + // Class queries an NFT class based on its id + rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}"; + } + + // Classes queries all NFT classes + rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method +message QueryBalanceRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method +message QueryBalanceResponse { + // amount is the number of all NFTs of a given class owned by the owner + uint64 amount = 1; +} + +// QueryOwnerRequest is the request type for the Query/Owner RPC method +message QueryOwnerRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryOwnerResponse is the response type for the Query/Owner RPC method +message QueryOwnerResponse { + // owner is the owner address of the nft + string owner = 1; +} + +// QuerySupplyRequest is the request type for the Query/Supply RPC method +message QuerySupplyRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QuerySupplyResponse is the response type for the Query/Supply RPC method +message QuerySupplyResponse { + // amount is the number of all NFTs from the given class + uint64 amount = 1; +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +message QueryNFTsRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +message QueryNFTsResponse { + // NFT defines the NFT + repeated cosmos.nft.v1beta1.NFT nfts = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +message QueryNFTRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +message QueryNFTResponse { + // owner is the owner address of the nft + cosmos.nft.v1beta1.NFT nft = 1; +} + +// QueryClassRequest is the request type for the Query/Class RPC method +message QueryClassRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QueryClassResponse is the response type for the Query/Class RPC method +message QueryClassResponse { + // class defines the class of the nft type. + cosmos.nft.v1beta1.Class class = 1; +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +message QueryClassesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +message QueryClassesResponse { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/nft/v1beta1/tx.proto b/proto/cosmos/nft/v1beta1/tx.proto new file mode 100644 index 00000000..0637cd8d --- /dev/null +++ b/proto/cosmos/nft/v1beta1/tx.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the nft Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Send defines a method to send a nft from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); +} + +// MsgSend represents a message to send a nft from one account to another account. +message MsgSend { + option (cosmos.msg.v1.signer) = "sender"; + + // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + string class_id = 1; + + // id defines the unique identification of nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // receiver is the receiver address of nft + string receiver = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} \ No newline at end of file diff --git a/proto/cosmos/orm/module/v1alpha1/module.proto b/proto/cosmos/orm/module/v1alpha1/module.proto new file mode 100644 index 00000000..cb7bbbee --- /dev/null +++ b/proto/cosmos/orm/module/v1alpha1/module.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package cosmos.orm.module.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module defines the ORM module which adds providers to the app container for +// module-scoped DB's. In the future it may provide gRPC services for interacting +// with ORM data. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/orm" + }; +} diff --git a/proto/cosmos/orm/query/v1alpha1/query.proto b/proto/cosmos/orm/query/v1alpha1/query.proto new file mode 100644 index 00000000..4500e99d --- /dev/null +++ b/proto/cosmos/orm/query/v1alpha1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package cosmos.orm.query.v1alpha1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +// Query is a generic gRPC service for querying ORM data. +service Query { + + // Get queries an ORM table against an unique index. + rpc Get(GetRequest) returns (GetResponse); + + // List queries an ORM table against an index. + rpc List(ListRequest) returns (ListResponse); +} + +// GetRequest is the Query/Get request type. +message GetRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. If it is non-empty, it must + // refer to an unique index. + string index = 2; + + // values are the values of the fields corresponding to the requested index. + // There must be as many values provided as there are fields in the index and + // these values must correspond to the index field types. + repeated IndexValue values = 3; +} + +// GetResponse is the Query/Get response type. +message GetResponse { + + // result is the result of the get query. If no value is found, the gRPC + // status code NOT_FOUND will be returned. + google.protobuf.Any result = 1; +} + +// ListRequest is the Query/List request type. +message ListRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. + string index = 2; + + // query is the query expression corresponding to the provided index. If + // neither prefix nor range is specified, the query will list all the fields + // in the index. + oneof query { + + // prefix defines a prefix query. + Prefix prefix = 3; + + // range defines a range query. + Range range = 4; + } + + // pagination is the pagination request. + cosmos.base.query.v1beta1.PageRequest pagination = 5; + + // Prefix specifies the arguments to a prefix query. + message Prefix { + // values specifies the index values for the prefix query. + // It is valid to special a partial prefix with fewer values than + // the number of fields in the index. + repeated IndexValue values = 1; + } + + // Range specifies the arguments to a range query. + message Range { + // start specifies the starting index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue start = 1; + + // end specifies the inclusive ending index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue end = 2; + } +} + +// ListResponse is the Query/List response type. +message ListResponse { + + // results are the results of the query. + repeated google.protobuf.Any results = 1; + + // pagination is the pagination response. + cosmos.base.query.v1beta1.PageResponse pagination = 5; +} + +// IndexValue represents the value of a field in an ORM index expression. +message IndexValue { + + // value specifies the index value + oneof value { + // uint specifies a value for an uint32, fixed32, uint64, or fixed64 + // index field. + uint64 uint = 1; + + // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + // index field. + int64 int = 2; + + // str specifies a value for a string index field. + string str = 3; + + // bytes specifies a value for a bytes index field. + bytes bytes = 4; + + // enum specifies a value for an enum index field. + string enum = 5; + + // bool specifies a value for a bool index field. + bool bool = 6; + + // timestamp specifies a value for a timestamp index field. + google.protobuf.Timestamp timestamp = 7; + + // duration specifies a value for a duration index field. + google.protobuf.Duration duration = 8; + } +} diff --git a/proto/cosmos/orm/v1/orm.proto b/proto/cosmos/orm/v1/orm.proto new file mode 100644 index 00000000..389babd1 --- /dev/null +++ b/proto/cosmos/orm/v1/orm.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package cosmos.orm.v1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + + // table specifies that this message will be used as an ORM table. It cannot + // be used together with the singleton option. + TableDescriptor table = 104503790; + + // singleton specifies that this message will be used as an ORM singleton. It cannot + // be used together with the table option. + SingletonDescriptor singleton = 104503791; +} + +// TableDescriptor describes an ORM table. +message TableDescriptor { + + // primary_key defines the primary key for the table. + PrimaryKeyDescriptor primary_key = 1; + + // index defines one or more secondary indexes. + repeated SecondaryIndexDescriptor index = 2; + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 3; +} + +// PrimaryKeyDescriptor describes a table primary key. +message PrimaryKeyDescriptor { + + // fields is a comma-separated list of fields in the primary key. Spaces are + // not allowed. Supported field types, their encodings, and any applicable constraints + // are described below. + // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers. + // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers such as auto-incrementing sequences. + // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + // sorted iteration. These types are well-suited for encoding fixed with + // decimals as integers. + // - string's are encoded as raw bytes in terminal key segments and null-terminated + // in non-terminal segments. Null characters are thus forbidden in strings. + // string fields support sorted iteration. + // - bytes are encoded as raw bytes in terminal segments and length-prefixed + // with a 32-bit unsigned varint in non-terminal segments. + // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + // an encoding that enables sorted iteration. + // - google.protobuf.Timestamp and google.protobuf.Duration are encoded + // as 12 bytes using an encoding that enables sorted iteration. + // - enum fields are encoded using varint encoding and do not support sorted + // iteration. + // - bool fields are encoded as a single byte 0 or 1. + // + // All other fields types are unsupported in keys including repeated and + // oneof fields. + // + // Primary keys are prefixed by the varint encoded table id and the byte 0x0 + // plus any additional prefix specified by the schema. + string fields = 1; + + // auto_increment specifies that the primary key is generated by an + // auto-incrementing integer. If this is set to true fields must only + // contain one field of that is of type uint64. + bool auto_increment = 2; +} + +// PrimaryKeyDescriptor describes a table secondary index. +message SecondaryIndexDescriptor { + + // fields is a comma-separated list of fields in the index. The supported + // field types are the same as those for PrimaryKeyDescriptor.fields. + // Index keys are prefixed by the varint encoded table id and the varint + // encoded index id plus any additional prefix specified by the schema. + // + // In addition the field segments, non-unique index keys are suffixed with + // any additional primary key fields not present in the index fields so that the + // primary key can be reconstructed. Unique indexes instead of being suffixed + // store the remaining primary key fields in the value.. + string fields = 1; + + // id is a non-zero integer ID that must be unique within the indexes for this + // table and less than 32768. It may be deprecated in the future when this can + // be auto-generated. + uint32 id = 2; + + // unique specifies that this an unique index. + bool unique = 3; +} + +// TableDescriptor describes an ORM singleton table which has at most one instance. +message SingletonDescriptor { + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 1; +} \ No newline at end of file diff --git a/proto/cosmos/orm/v1alpha1/schema.proto b/proto/cosmos/orm/v1alpha1/schema.proto new file mode 100644 index 00000000..ab713340 --- /dev/null +++ b/proto/cosmos/orm/v1alpha1/schema.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package cosmos.orm.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module_schema is used to define the ORM schema for an app module. + // All module config messages that use module_schema must also declare + // themselves as app module config messages using the cosmos.app.v1.is_module + // option. + ModuleSchemaDescriptor module_schema = 104503792; +} + +// ModuleSchemaDescriptor describe's a module's ORM schema. +message ModuleSchemaDescriptor { + repeated FileEntry schema_file = 1; + + // FileEntry describes an ORM file used in a module. + message FileEntry { + // id is a prefix that will be varint encoded and prepended to all the + // table keys specified in the file's tables. + uint32 id = 1; + + // proto_file_name is the name of a file .proto in that contains + // table definitions. The .proto file must be in a package that the + // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + string proto_file_name = 2; + + // storage_type optionally indicates the type of storage this file's + // tables should used. If it is left unspecified, the default KV-storage + // of the app will be used. + StorageType storage_type = 3; + } + + // prefix is an optional prefix that precedes all keys in this module's + // store. + bytes prefix = 2; +} + +// StorageType +enum StorageType { + // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + // KV-storage where primary key entries are stored in merkle-tree + // backed commitment storage and indexes and seqs are stored in + // fast index storage. Note that the Cosmos SDK before store/v2alpha1 + // does not support this. + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; + + // STORAGE_TYPE_MEMORY indicates in-memory storage that will be + // reloaded every time an app restarts. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_MEMORY = 1; + + // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + // at the end of every block. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_TRANSIENT = 2; + + // STORAGE_TYPE_INDEX indicates persistent storage which is not backed + // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + // before store/v2alpha1 does not support this. + STORAGE_TYPE_INDEX = 3; + + // STORAGE_TYPE_INDEX indicates persistent storage which is backed by + // a merkle-tree. With this type of storage, both primary and index keys + // will affect the app hash and this is generally less efficient + // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + // keys into index storage. Note that modules built with the + // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + // because this is the only type of persistent storage available. + STORAGE_TYPE_COMMITMENT = 4; +} diff --git a/proto/cosmos/params/module/v1/module.proto b/proto/cosmos/params/module/v1/module.proto new file mode 100644 index 00000000..75e7f995 --- /dev/null +++ b/proto/cosmos/params/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.params.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the params module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/params" + }; +} diff --git a/proto/cosmos/params/v1beta1/params.proto b/proto/cosmos/params/v1beta1/params.proto new file mode 100644 index 00000000..7bda4651 --- /dev/null +++ b/proto/cosmos/params/v1beta1/params.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// ParameterChangeProposal defines a proposal to change one or more parameters. +message ParameterChangeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; + + string title = 1; + string description = 2; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ParamChange defines an individual parameter change, for use in +// ParameterChangeProposal. +message ParamChange { + option (gogoproto.goproto_stringer) = false; + + string subspace = 1; + string key = 2; + string value = 3; +} diff --git a/proto/cosmos/params/v1beta1/query.proto b/proto/cosmos/params/v1beta1/query.proto new file mode 100644 index 00000000..827422ea --- /dev/null +++ b/proto/cosmos/params/v1beta1/query.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/params/v1beta1/params.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; + +// Query defines the gRPC querier service. +service Query { + // Params queries a specific parameter of a module, given its subspace and + // key. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/params"; + } + + // Subspaces queries for all registered subspaces and all keys for a subspace. + // + // Since: cosmos-sdk 0.46 + rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest { + // subspace defines the module to query the parameter for. + string subspace = 1; + + // key defines the key of the parameter in the subspace. + string key = 2; +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // param defines the queried parameter. + ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySubspacesRequest defines a request type for querying for all registered +// subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesRequest {} + +// QuerySubspacesResponse defines the response types for querying for all +// registered subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesResponse { + repeated Subspace subspaces = 1; +} + +// Subspace defines a parameter subspace name and all the keys that exist for +// the subspace. +// +// Since: cosmos-sdk 0.46 +message Subspace { + string subspace = 1; + repeated string keys = 2; +} diff --git a/proto/cosmos/query/v1/query.proto b/proto/cosmos/query/v1/query.proto new file mode 100644 index 00000000..e42e73d7 --- /dev/null +++ b/proto/cosmos/query/v1/query.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package cosmos.query.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO: once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +extend google.protobuf.MethodOptions { + // module_query_safe is set to true when the query is safe to be called from + // within the state machine, for example from another module's Keeper, via + // ADR-033 calls or from CosmWasm contracts. + // Concretely, it means that the query is: + // 1. deterministic: given a block height, returns the exact same response + // upon multiple calls; and doesn't introduce any state-machine-breaking + // changes across SDK patch version. + // 2. consumes gas correctly. + // + // If you are a module developer and want to add this annotation to one of + // your own queries, please make sure that the corresponding query: + // 1. is deterministic and won't introduce state-machine-breaking changes + // without a coordinated upgrade path, + // 2. has its gas tracked, to avoid the attack vector where no gas is + // accounted for on potentially high-computation queries. + // + // For queries that potentially consume a large amount of gas (for example + // those with pagination, if the pagination field is incorrectly set), we + // also recommend adding Protobuf comments to warn module developers + // consuming these queries. + // + // When set to true, the query can safely be called + bool module_query_safe = 11110001; +} \ No newline at end of file diff --git a/proto/cosmos/reflection/v1/reflection.proto b/proto/cosmos/reflection/v1/reflection.proto new file mode 100644 index 00000000..1f575b83 --- /dev/null +++ b/proto/cosmos/reflection/v1/reflection.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cosmos.reflection.v1; + +import "google/protobuf/descriptor.proto"; +import "cosmos/query/v1/query.proto"; + +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. +service ReflectionService { + // FileDescriptors queries all the file descriptors in the app in order + // to enable easier generation of dynamic clients. + rpc FileDescriptors(FileDescriptorsRequest) returns (FileDescriptorsResponse) { + // NOTE: file descriptors SHOULD NOT be part of consensus because they + // include changes to doc commands and module_query_safe should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// FileDescriptorsRequest is the Query/FileDescriptors request type. +message FileDescriptorsRequest {} + +// FileDescriptorsResponse is the Query/FileDescriptors response type. +message FileDescriptorsResponse { + // files is the file descriptors. + repeated google.protobuf.FileDescriptorProto files = 1; +} diff --git a/proto/cosmos/slashing/module/v1/module.proto b/proto/cosmos/slashing/module/v1/module.proto new file mode 100644 index 00000000..52433075 --- /dev/null +++ b/proto/cosmos/slashing/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.slashing.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the slashing module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/slashing" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto new file mode 100644 index 00000000..36bcf76f --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/genesis.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// GenesisState defines the slashing module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // signing_infos represents a map between validator addresses and their + // signing infos. + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // missed_blocks represents a map between validator addresses and their + // missed blocks. + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// SigningInfo stores validator signing info of corresponding address. +message SigningInfo { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_signing_info represents the signing info of this validator. + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// ValidatorMissedBlocks contains array of missed blocks of corresponding +// address. +message ValidatorMissedBlocks { + // address is the validator address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // missed_blocks is an array of missed blocks by the validator. + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MissedBlock contains height and missed status as boolean. +message MissedBlock { + // index is the height at which the block was missed. + int64 index = 1; + // missed is the missed status. + bool missed = 2; +} diff --git a/proto/cosmos/slashing/v1beta1/query.proto b/proto/cosmos/slashing/v1beta1/query.proto new file mode 100644 index 00000000..761e1a4b --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/query.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the parameters of slashing module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; + } + + // SigningInfo queries the signing info of given cons address + rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; + } + + // SigningInfos queries signing info of all validators + rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +// method +message QuerySigningInfoRequest { + // cons_address is the address to query signing info of + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +// method +message QuerySigningInfoResponse { + // val_signing_info is the signing info of requested val cons address + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC +// method +message QuerySigningInfosRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC +// method +message QuerySigningInfosResponse { + // info is the signing info of all validators + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto new file mode 100644 index 00000000..dc1f4211 --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Height at which validator was first a candidate OR was unjailed + int64 start_height = 2; + // Index which is incremented each time the validator was a bonded + // in a block and may have signed a precommit or not. This in conjunction with the + // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + int64 index_offset = 3; + // Timestamp until which the validator is jailed due to liveness downtime. + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // Whether or not a validator has been tombstoned (killed out of validator set). It is set + // once the validator commits an equivocation or for any other configured misbehiavor. + bool tombstoned = 5; + // A counter kept to avoid unnecessary array reads. + // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + int64 missed_blocks_counter = 6; +} + +// Params represents the parameters used for by the slashing module. +message Params { + option (amino.name) = "cosmos-sdk/x/slashing/Params"; + + int64 signed_blocks_window = 1; + bytes min_signed_per_window = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto new file mode 100644 index 00000000..300fc775 --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/tx.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg defines the slashing Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); + + // UpdateParams defines a governance operation for updating the x/slashing module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUnjail defines the Msg/Unjail request type +message MsgUnjail { + option (cosmos.msg.v1.signer) = "validator_addr"; + option (amino.name) = "cosmos-sdk/MsgUnjail"; + + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_addr = 1 [ + (cosmos_proto.scalar) = "cosmos.AddressString", + (gogoproto.jsontag) = "address", + (amino.field_name) = "address", + (amino.dont_omitempty) = true + ]; +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/slashing/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/slashing parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/staking/module/v1/module.proto b/proto/cosmos/staking/module/v1/module.proto new file mode 100644 index 00000000..7ef4a06c --- /dev/null +++ b/proto/cosmos/staking/module/v1/module.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.staking.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the staking module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/staking" + }; + + // hooks_order specifies the order of staking hooks and should be a list + // of module names which provide a staking hooks instance. If no order is + // provided, then hooks will be applied in alphabetical order of module names. + repeated string hooks_order = 1; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 2; +} diff --git a/proto/cosmos/staking/v1beta1/authz.proto b/proto/cosmos/staking/v1beta1/authz.proto new file mode 100644 index 00000000..055d1b64 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/authz.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +// +// Since: cosmos-sdk 0.43 +message StakeAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/StakeAuthorization"; + + // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + // empty, there is no spend limit and any amount of coins can be delegated. + cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + // validators is the oneof that represents either allow_list or deny_list + oneof validators { + // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + // account. + Validators allow_list = 2; + // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + Validators deny_list = 3; + } + // Validators defines list of validator addresses. + message Validators { + repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + } + // authorization_type defines one of AuthorizationType. + AuthorizationType authorization_type = 4; +} + +// AuthorizationType defines the type of staking module authorization type +// +// Since: cosmos-sdk 0.43 +enum AuthorizationType { + // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + AUTHORIZATION_TYPE_DELEGATE = 1; + // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + AUTHORIZATION_TYPE_UNDELEGATE = 2; + // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + AUTHORIZATION_TYPE_REDELEGATE = 3; +} diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto new file mode 100644 index 00000000..482d50cc --- /dev/null +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +// GenesisState defines the staking module's genesis state. +message GenesisState { + // params defines all the parameters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // last_total_power tracks the total amounts of bonded tokens recorded during + // the previous end block. + bytes last_total_power = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // last_validator_powers is a special index that provides a historical list + // of the last-block's bonded validators. + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // delegations defines the validator set at genesis. + repeated Validator validators = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // delegations defines the delegations active at genesis. + repeated Delegation delegations = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // unbonding_delegations defines the unbonding delegations active at genesis. + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // redelegations defines the redelegations active at genesis. + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + bool exported = 8; +} + +// LastValidatorPower required for validator set update logic. +message LastValidatorPower { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the validator. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // power defines the power of the validator. + int64 power = 2; +} diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto new file mode 100644 index 00000000..06eb5551 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,387 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Query defines the gRPC querier service. +service Query { + // Validators queries all validators that match the given status. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + } + + // Validator queries validator info for given validator address. + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + } + + // ValidatorDelegations queries delegate info for given validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + } + + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) + returns (QueryValidatorUnbondingDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; + } + + // Delegation queries delegate info for given validator delegator pair. + rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; + } + + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; + } + + // DelegatorDelegations queries all delegations of a given delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + } + + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) + returns (QueryDelegatorUnbondingDelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; + } + + // Redelegations queries redelegations of given address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + } + + // DelegatorValidators queries all validators info for given delegator + // address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + } + + // DelegatorValidator queries validator info for given delegator validator + // pair. + rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; + } + + // HistoricalInfo queries the historical info for given height. + rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + } + + // Pool queries the pool info. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + } + + // Parameters queries the staking parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorsResponse is response type for the Query/Validators RPC method +message QueryValidatorsResponse { + // validators contains all the queried validators. + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorRequest is response type for the Query/Validator RPC method +message QueryValidatorRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDelegationsRequest is request type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegationResponse is response type for the Query/UnbondingDelegation +// RPC method. +message QueryUnbondingDelegationResponse { + // unbond defines the unbonding information of a delegation. + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + repeated RedelegationResponse redelegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // validators defines the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // validator_addr defines the validator address to query for. + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest {} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + // pool defines the pool info. + Pool pool = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto new file mode 100644 index 00000000..e7620c55 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -0,0 +1,405 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "tendermint/types/types.proto"; +import "tendermint/abci/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// HistoricalInfo contains header and validator information for a given block. +// It is stored as part of staking module's state, which persists the `n` most +// recent HistoricalInfo +// (`n` is set by the staking module's `historical_entries` parameter). +message HistoricalInfo { + tendermint.types.Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Validator valset = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// CommissionRates defines the initial commission rates to be used for creating +// a validator. +message CommissionRates { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // rate is the commission rate charged to delegators, as a fraction. + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. + string max_rate = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. + string max_change_rate = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Commission defines commission parameters for a given validator. +message Commission { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // commission_rates defines the initial commission rates to be used for creating a validator. + CommissionRates commission_rates = 1 + [(gogoproto.embed) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // update_time is the last time the commission rate was changed. + google.protobuf.Timestamp update_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Description defines a validator description. +message Description { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // moniker defines a human-readable name for the validator. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4; + // details define other optional details. + string details = 5; +} + +// Validator defines a validator, together with the total amount of the +// Validator's bond shares and their exchange rate to coins. Slashing results in +// a decrease in the exchange rate, allowing correct calculation of future +// undelegations without iterating over delegators. When coins are delegated to +// this validator, the validator is credited with a delegation whose number of +// bond shares is based on the amount of coins delegated divided by the current +// exchange rate. Voting power can be calculated as total bonded shares +// multiplied by exchange rate. +message Validator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // jailed defined whether the validator has been jailed from bonded status or not. + bool jailed = 3; + // status is the validator status (bonded/unbonding/unbonded). + BondStatus status = 4; + // tokens define the delegated tokens (incl. self-delegation). + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // delegator_shares defines total shares issued to a validator's delegators. + string delegator_shares = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // description defines the description terms for the validator. + Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + int64 unbonding_height = 8; + // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. + google.protobuf.Timestamp unbonding_time = 9 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // commission defines the commission parameters. + Commission commission = 10 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // min_self_delegation is the validator's self declared minimum self delegation. + // + // Since: cosmos-sdk 0.46 + string min_self_delegation = 11 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // strictly positive if this validator's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 12; + + // list of unbonding ids, each uniquely identifing an unbonding of this validator + repeated uint64 unbonding_ids = 13; +} + +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + +// ValAddresses defines a repeated set of validator addresses. +message ValAddresses { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = true; + + repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPair is struct that just has a delegator-validator pair with no other data. +// It is intended to be used as a marshalable pointer. For example, a DVPair can +// be used to construct the key to getting an UnbondingDelegation from state. +message DVPair { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVPairs defines an array of DVPair objects. +message DVPairs { + repeated DVPair pairs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// DVVTriplet is struct that just has a delegator-validator-validator triplet +// with no other data. It is intended to be used as a marshalable pointer. For +// example, a DVVTriplet can be used to construct the key to getting a +// Redelegation from state. +message DVVTriplet { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// DVVTriplets defines an array of DVVTriplet objects. +message DVVTriplets { + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Delegation represents the bond with tokens held by an account. It is +// owned by one delegator, and is associated with the voting power of one +// validator. +message Delegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // shares define the delegation shares received. + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// UnbondingDelegation stores all of a single delegator's unbonding bonds +// for a single validator in an time-ordered list. +message UnbondingDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the unbonding delegation entries. + repeated UnbondingDelegationEntry entries = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries +} + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +message UnbondingDelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height is the height which the unbonding took place. + int64 creation_height = 1; + // completion_time is the unix time for unbonding completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // initial_balance defines the tokens initially scheduled to receive at completion. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // balance defines the tokens to receive at completion. + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// RedelegationEntry defines a redelegation object with relevant metadata. +message RedelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height defines the height which the redelegation took place. + int64 creation_height = 1; + // completion_time defines the unix time for redelegation completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // initial_balance defines the initial balance when redelegation started. + string initial_balance = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // shares_dst is the amount of destination-validator shares created by redelegation. + string shares_dst = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // Incrementing id that uniquely identifies this entry + uint64 unbonding_id = 5; + + // Strictly positive if this entry's unbonding has been stopped by external modules + int64 unbonding_on_hold_ref_count = 6; +} + +// Redelegation contains the list of a particular delegator's redelegating bonds +// from a particular source validator to a particular destination validator. +message Redelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_src_address is the validator redelegation source operator address. + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_dst_address is the validator redelegation destination operator address. + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // entries are the redelegation entries. + repeated RedelegationEntry entries = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries +} + +// Params defines the parameters for the x/staking module. +message Params { + option (amino.name) = "cosmos-sdk/x/staking/Params"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; + // max_validators is the maximum number of validators. + uint32 max_validators = 2; + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + uint32 max_entries = 3; + // historical_entries is the number of historical entries to persist. + uint32 historical_entries = 4; + // bond_denom defines the bondable coin denomination. + string bond_denom = 5; + // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + string min_commission_rate = 6 [ + (gogoproto.moretags) = "yaml:\"min_commission_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// DelegationResponse is equivalent to Delegation except that it contains a +// balance in addition to shares which is more suitable for client responses. +message DelegationResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + + Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +message RedelegationEntryResponse { + option (gogoproto.equal) = true; + + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// RedelegationResponse is equivalent to a Redelegation except that its entries +// contain a balance in addition to shares which is more suitable for client +// responses. +message RedelegationResponse { + option (gogoproto.equal) = false; + + Redelegation redelegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Pool is used for tracking bonded and not-bonded token supply of the bond +// denomination. +message Pool { + option (gogoproto.description) = true; + option (gogoproto.equal) = true; + string not_bonded_tokens = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "not_bonded_tokens", + (amino.dont_omitempty) = true + ]; + string bonded_tokens = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "bonded_tokens", + (amino.dont_omitempty) = true + ]; +} + +// Infraction indicates the infraction a validator commited. +enum Infraction { + // UNSPECIFIED defines an empty infraction. + INFRACTION_UNSPECIFIED = 0; + // DOUBLE_SIGN defines a validator that double-signs a block. + INFRACTION_DOUBLE_SIGN = 1; + // DOWNTIME defines a validator that missed signing too many blocks. + INFRACTION_DOWNTIME = 2; +} + +// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +message ValidatorUpdates { + repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto new file mode 100644 index 00000000..42e2218e --- /dev/null +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -0,0 +1,201 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Msg defines the staking Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); + + // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + // and delegate back to previous validator. + // + // Since: cosmos-sdk 0.46 + rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); + + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. +message MsgCreateValidator { + // NOTE(fdymylja): this is a particular case in which + // if validator_address == delegator_address then only one + // is expected to sign, otherwise both are. + option (cosmos.msg.v1.signer) = "delegator_address"; + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgCreateValidator"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string min_self_delegation = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse {} + +// MsgEditValidator defines a SDK message for editing an existing validator. +message MsgEditValidator { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgEditValidator"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // We pass a reference to the new commission rate and min self delegation as + // it's not mandatory to update. If not updated, the deserialized rate will be + // zero with no way to distinguish if an update was intended. + // REF: #2373 + string commission_rate = 3 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_self_delegation = 4 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} + +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse {} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message MsgDelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgDelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse {} + +// MsgBeginRedelegate defines a SDK message for performing a redelegation +// of coins from a delegator and source validator to a destination validator. +message MsgBeginRedelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a +// delegate and a validator. +message MsgUndelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // amount is always less than or equal to unbonding delegation entry balance + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // creation_height is the height which the unbonding took place. + int64 creation_height = 4; +} + +// MsgCancelUnbondingDelegationResponse +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegationResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/staking/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/staking parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +}; + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {}; diff --git a/proto/cosmos/tx/config/v1/config.proto b/proto/cosmos/tx/config/v1/config.proto new file mode 100644 index 00000000..15553a28 --- /dev/null +++ b/proto/cosmos/tx/config/v1/config.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.tx.config.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Config is the config object of the x/auth/tx package. +message Config { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/tx" + }; + + // skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_ante_handler = 1; + + // skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_post_handler = 2; +} \ No newline at end of file diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto new file mode 100644 index 00000000..12d5868b --- /dev/null +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -0,0 +1,106 @@ +syntax = "proto3"; +package cosmos.tx.signing.v1beta1; + +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; + +// SignMode represents a signing mode with its own security guarantees. +// +// This enum should be considered a registry of all known sign modes +// in the Cosmos ecosystem. Apps are not expected to support all known +// sign modes. Apps that would like to support custom sign modes are +// encouraged to open a small PR against this file to add a new case +// to this SignMode enum describing their sign mode so that different +// apps have a consistent version of this enum. +enum SignMode { + // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + // rejected. + SIGN_MODE_UNSPECIFIED = 0; + + // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + // verified with raw bytes from Tx. + SIGN_MODE_DIRECT = 1; + + // SIGN_MODE_TEXTUAL is a future signing mode that will verify some + // human-readable textual representation on top of the binary representation + // from SIGN_MODE_DIRECT. It is currently not supported. + SIGN_MODE_TEXTUAL = 2; + + // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + // require signers signing over other signers' `signer_info`. It also allows + // for adding Tips in transactions. + // + // Since: cosmos-sdk 0.46 + SIGN_MODE_DIRECT_AUX = 3; + + // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + // Amino JSON and will be removed in the future. + SIGN_MODE_LEGACY_AMINO_JSON = 127; + + // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + // + // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + // but is not implemented on the SDK by default. To enable EIP-191, you need + // to pass a custom `TxConfig` that has an implementation of + // `SignModeHandler` for EIP-191. The SDK may decide to fully support + // EIP-191 in the future. + // + // Since: cosmos-sdk 0.45.2 + SIGN_MODE_EIP_191 = 191; +} + +// SignatureDescriptors wraps multiple SignatureDescriptor's. +message SignatureDescriptors { + // signatures are the signature descriptors + repeated SignatureDescriptor signatures = 1; +} + +// SignatureDescriptor is a convenience type which represents the full data for +// a signature including the public key of the signer, signing modes and the +// signature itself. It is primarily used for coordinating signatures between +// clients. +message SignatureDescriptor { + // public_key is the public key of the signer + google.protobuf.Any public_key = 1; + + Data data = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to prevent + // replay attacks. + uint64 sequence = 3; + + // Data represents signature data + message Data { + // sum is the oneof that specifies whether this represents single or multi-signature data + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a multisig signer + Multi multi = 2; + } + + // Single is the signature data for a single signer + message Single { + // mode is the signing mode of the single signer + SignMode mode = 1; + + // signature is the raw signature bytes + bytes signature = 2; + } + + // Multi is the signature data for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // signatures is the signatures of the multi-signature + repeated Data signatures = 2; + } + } +} diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto new file mode 100644 index 00000000..16b3de0d --- /dev/null +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -0,0 +1,277 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/tx/v1beta1/tx.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "tendermint/types/block.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Service defines a gRPC service for interacting with transactions. +service Service { + // Simulate simulates executing a transaction for estimating gas usage. + rpc Simulate(SimulateRequest) returns (SimulateResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/simulate" + body: "*" + }; + } + // GetTx fetches a tx by hash. + rpc GetTx(GetTxRequest) returns (GetTxResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; + } + // BroadcastTx broadcast transaction. + rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/txs" + body: "*" + }; + } + // GetTxsEvent fetches txs by event. + rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; + } + // GetBlockWithTxs fetches a block with decoded txs. + // + // Since: cosmos-sdk 0.45.2 + rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; + } + // TxDecode decodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxDecode(TxDecodeRequest) returns (TxDecodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode" + body: "*" + }; + } + // TxEncode encodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxEncode(TxEncodeRequest) returns (TxEncodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode" + body: "*" + }; + } + // TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + // + // Since: cosmos-sdk 0.47 + rpc TxEncodeAmino(TxEncodeAminoRequest) returns (TxEncodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode/amino" + body: "*" + }; + } + // TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + // + // Since: cosmos-sdk 0.47 + rpc TxDecodeAmino(TxDecodeAminoRequest) returns (TxDecodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode/amino" + body: "*" + }; + } +} + +// GetTxsEventRequest is the request type for the Service.TxsByEvents +// RPC method. +message GetTxsEventRequest { + // events is the list of transaction event type. + repeated string events = 1; + // pagination defines a pagination for the request. + // Deprecated post v0.46.x: use page and limit instead. + cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; + + OrderBy order_by = 3; + // page is the page number to query, starts at 1. If not provided, will default to first page. + uint64 page = 4; + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 5; +} + +// OrderBy defines the sorting order +enum OrderBy { + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + ORDER_BY_UNSPECIFIED = 0; + // ORDER_BY_ASC defines ascending order + ORDER_BY_ASC = 1; + // ORDER_BY_DESC defines descending order + ORDER_BY_DESC = 2; +} + +// GetTxsEventResponse is the response type for the Service.TxsByEvents +// RPC method. +message GetTxsEventResponse { + // txs is the list of queried transactions. + repeated cosmos.tx.v1beta1.Tx txs = 1; + // tx_responses is the list of queried TxResponses. + repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; + // pagination defines a pagination for the response. + // Deprecated post v0.46.x: use total instead. + cosmos.base.query.v1beta1.PageResponse pagination = 3 [deprecated = true]; + // total is total number of results available + uint64 total = 4; +} + +// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +// RPC method. +message BroadcastTxRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; + BroadcastMode mode = 2; +} + +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +enum BroadcastMode { + // zero-value for mode ordering + BROADCAST_MODE_UNSPECIFIED = 0; + // DEPRECATED: use BROADCAST_MODE_SYNC instead, + // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + BROADCAST_MODE_BLOCK = 1 [deprecated = true]; + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + // a CheckTx execution response only. + BROADCAST_MODE_SYNC = 2; + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + // immediately. + BROADCAST_MODE_ASYNC = 3; +} + +// BroadcastTxResponse is the response type for the +// Service.BroadcastTx method. +message BroadcastTxResponse { + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 1; +} + +// SimulateRequest is the request type for the Service.Simulate +// RPC method. +message SimulateRequest { + // tx is the transaction to simulate. + // Deprecated. Send raw tx bytes instead. + cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; + // tx_bytes is the raw transaction. + // + // Since: cosmos-sdk 0.43 + bytes tx_bytes = 2; +} + +// SimulateResponse is the response type for the +// Service.SimulateRPC method. +message SimulateResponse { + // gas_info is the information about gas used in the simulation. + cosmos.base.abci.v1beta1.GasInfo gas_info = 1; + // result is the result of the simulation. + cosmos.base.abci.v1beta1.Result result = 2; +} + +// GetTxRequest is the request type for the Service.GetTx +// RPC method. +message GetTxRequest { + // hash is the tx hash to query, encoded as a hex string. + string hash = 1; +} + +// GetTxResponse is the response type for the Service.GetTx method. +message GetTxResponse { + // tx is the queried transaction. + cosmos.tx.v1beta1.Tx tx = 1; + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 2; +} + +// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +// RPC method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsRequest { + // height is the height of the block to query. + int64 height = 1; + // pagination defines a pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// +// Since: cosmos-sdk 0.45.2 +message GetBlockWithTxsResponse { + // txs are the transactions in the block. + repeated cosmos.tx.v1beta1.Tx txs = 1; + .tendermint.types.BlockID block_id = 2; + .tendermint.types.Block block = 3; + // pagination defines a pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 4; +} + +// TxDecodeRequest is the request type for the Service.TxDecode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; +} + +// TxDecodeResponse is the response type for the +// Service.TxDecode method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeResponse { + // tx is the decoded transaction. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeRequest is the request type for the Service.TxEncode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeRequest { + // tx is the transaction to encode. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeResponse is the response type for the +// Service.TxEncode method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeResponse { + // tx_bytes is the encoded transaction bytes. + bytes tx_bytes = 1; +} + +// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoRequest { + string amino_json = 1; +} + +// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoResponse { + bytes amino_binary = 1; +} + +// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoRequest { + bytes amino_binary = 1; +} + +// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoResponse { + string amino_json = 1; +} diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto new file mode 100644 index 00000000..a71a3e11 --- /dev/null +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -0,0 +1,256 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Tx is the standard type used for broadcasting transactions. +message Tx { + // body is the processable content of the transaction + TxBody body = 1; + + // auth_info is the authorization related content of the transaction, + // specifically signers, signer modes and fee + AuthInfo auth_info = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// TxRaw is a variant of Tx that pins the signer's exact binary representation +// of body and auth_info. This is used for signing, broadcasting and +// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +// as the transaction ID. +message TxRaw { + // body_bytes is a protobuf serialization of a TxBody that matches the + // representation in SignDoc. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in SignDoc. + bytes auth_info_bytes = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +message SignDoc { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in TxRaw. + bytes auth_info_bytes = 2; + + // chain_id is the unique identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker + string chain_id = 3; + + // account_number is the account number of the account in state + uint64 account_number = 4; +} + +// SignDocDirectAux is the type used for generating sign bytes for +// SIGN_MODE_DIRECT_AUX. +// +// Since: cosmos-sdk 0.46 +message SignDocDirectAux { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // public_key is the public key of the signing account. + google.protobuf.Any public_key = 2; + + // chain_id is the identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker. + string chain_id = 3; + + // account_number is the account number of the account in state. + uint64 account_number = 4; + + // sequence is the sequence number of the signing account. + uint64 sequence = 5; + + // Tip is the optional tip used for transactions fees paid in another denom. + // It should be left empty if the signer is not the tipper for this + // transaction. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. + Tip tip = 6; +} + +// TxBody is the body of a transaction that all signers sign over. +message TxBody { + // messages is a list of messages to be executed. The required signers of + // those messages define the number and order of elements in AuthInfo's + // signer_infos and Tx's signatures. Each required signer address is added to + // the list only the first time it occurs. + // By convention, the first required signer (usually from the first message) + // is referred to as the primary signer and pays the fee for the whole + // transaction. + repeated google.protobuf.Any messages = 1; + + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + string memo = 2; + + // timeout is the block height after which this transaction will not + // be processed by the chain + uint64 timeout_height = 3; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, the transaction will be rejected + repeated google.protobuf.Any extension_options = 1023; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, they will be ignored + repeated google.protobuf.Any non_critical_extension_options = 2047; +} + +// AuthInfo describes the fee and signer modes that are used to sign a +// transaction. +message AuthInfo { + // signer_infos defines the signing modes for the required signers. The number + // and order of elements must match the required signers from TxBody's + // messages. The first element is the primary signer and the one which pays + // the fee. + repeated SignerInfo signer_infos = 1; + + // Fee is the fee and gas limit for the transaction. The first signer is the + // primary signer and the one which pays the fee. The fee can be calculated + // based on the cost of evaluating the body and doing signature verification + // of the signers. This can be estimated via simulation. + Fee fee = 2; + + // Tip is the optional tip used for transactions fees paid in another denom. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. + // + // Since: cosmos-sdk 0.46 + Tip tip = 3; +} + +// SignerInfo describes the public key and signing mode of a single top-level +// signer. +message SignerInfo { + // public_key is the public key of the signer. It is optional for accounts + // that already exist in state. If unset, the verifier can use the required \ + // signer address for this position and lookup the public key. + google.protobuf.Any public_key = 1; + + // mode_info describes the signing mode of the signer and is a nested + // structure to support nested multisig pubkey's + ModeInfo mode_info = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to + // prevent replay attacks. + uint64 sequence = 3; +} + +// ModeInfo describes the signing mode of a single or nested multisig signer. +message ModeInfo { + // sum is the oneof that specifies whether this represents a single or nested + // multisig signer + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a nested multisig signer + Multi multi = 2; + } + + // Single is the mode info for a single signer. It is structured as a message + // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + // future + message Single { + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + } + + // Multi is the mode info for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // mode_infos is the corresponding modes of the signers of the multisig + // which could include nested multisig public keys + repeated ModeInfo mode_infos = 2; + } +} + +// Fee includes the amount of coins paid in fees and the maximum +// gas to be used by the transaction. The ratio yields an effective "gasprice", +// which must be above some miminum to be accepted into the mempool. +message Fee { + // amount is the amount of coins to be paid as a fee + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // gas_limit is the maximum gas that can be used in transaction processing + // before an out of gas error occurs + uint64 gas_limit = 2; + + // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + // the payer must be a tx signer (and thus have signed this field in AuthInfo). + // setting this field does *not* change the ordering of required signers for the transaction. + string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + // not support fee grants, this will fail + string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// Tip is the tip used for meta-transactions. +// +// Since: cosmos-sdk 0.46 +message Tip { + // amount is the amount of the tip + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // tipper is the address of the account paying for the tip + string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +// tipper) builds and sends to the fee payer (who will build and broadcast the +// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +// by the node if sent directly as-is. +// +// Since: cosmos-sdk 0.46 +message AuxSignerData { + // address is the bech32-encoded address of the auxiliary signer. If using + // AuxSignerData across different chains, the bech32 prefix of the target + // chain (where the final transaction is broadcasted) should be used. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + // signs. Note: we use the same sign doc even if we're signing with + // LEGACY_AMINO_JSON. + SignDocDirectAux sign_doc = 2; + // mode is the signing mode of the single signer. + cosmos.tx.signing.v1beta1.SignMode mode = 3; + // sig is the signature of the sign doc. + bytes sig = 4; +} diff --git a/proto/cosmos/upgrade/module/v1/module.proto b/proto/cosmos/upgrade/module/v1/module.proto new file mode 100644 index 00000000..a4cf5808 --- /dev/null +++ b/proto/cosmos/upgrade/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.upgrade.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the upgrade module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/upgrade" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/proto/cosmos/upgrade/v1beta1/query.proto b/proto/cosmos/upgrade/v1beta1/query.proto new file mode 100644 index 00000000..870cf9ee --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/query.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Query defines the gRPC upgrade querier service. +service Query { + // CurrentPlan queries the current upgrade plan. + rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; + } + + // AppliedPlan queries a previously applied upgrade plan by its name. + rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; + } + + // UpgradedConsensusState queries the consensus state that will serve + // as a trusted kernel for the next version of this chain. It will only be + // stored at the last height of this chain. + // UpgradedConsensusState RPC not supported with legacy querier + // This rpc is deprecated now that IBC has its own replacement + // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option deprecated = true; + option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; + } + + // ModuleVersions queries the list of module versions from state. + // + // Since: cosmos-sdk 0.43 + rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; + } + + // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 + rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; + } +} + +// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanRequest {} + +// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanResponse { + // plan is the current upgrade plan. + Plan plan = 1; +} + +// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanRequest { + // name is the name of the applied plan to query for. + string name = 1; +} + +// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanResponse { + // height is the block height at which the plan was applied. + int64 height = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateRequest { + option deprecated = true; + + // last height of the current chain must be sent in request + // as this is the height under which next consensus state is stored + int64 last_height = 1; +} + +// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateResponse { + option deprecated = true; + reserved 1; + + // Since: cosmos-sdk 0.43 + bytes upgraded_consensus_state = 2; +} + +// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsRequest { + // module_name is a field to query a specific module + // consensus version from state. Leaving this empty will + // fetch the full list of module versions from state + string module_name = 1; +} + +// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +// RPC method. +// +// Since: cosmos-sdk 0.43 +message QueryModuleVersionsResponse { + // module_versions is a list of module names with their consensus versions. + repeated ModuleVersion module_versions = 1; +} + +// QueryAuthorityRequest is the request type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityRequest {} + +// QueryAuthorityResponse is the response type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityResponse { + string address = 1; +} \ No newline at end of file diff --git a/proto/cosmos/upgrade/v1beta1/tx.proto b/proto/cosmos/upgrade/v1beta1/tx.proto new file mode 100644 index 00000000..293bea02 --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/tx.proto @@ -0,0 +1,62 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Msg defines the upgrade Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SoftwareUpgrade is a governance operation for initiating a software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); + + // CancelUpgrade is a governance operation for cancelling a previously + // approved software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); +} + +// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSoftwareUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // plan is the upgrade plan. + Plan plan = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgradeResponse {} + +// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgCancelUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgradeResponse {} diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 00000000..0a967168 --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (amino.name) = "cosmos-sdk/Plan"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 + [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // The height at which the upgrade must be performed. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +message SoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; + + // plan of the proposal + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +message CancelSoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/proto/cosmos/vesting/module/v1/module.proto b/proto/cosmos/vesting/module/v1/module.proto new file mode 100644 index 00000000..88bb89c1 --- /dev/null +++ b/proto/cosmos/vesting/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.vesting.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the vesting module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" + }; +} \ No newline at end of file diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto new file mode 100644 index 00000000..42d3213f --- /dev/null +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/vesting/v1beta1/vesting.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); + // CreatePermanentLockedAccount defines a method that enables creating a permanent + // locked account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); + // CreatePeriodicVestingAccount defines a method that enables creating a + // periodic vesting account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); +} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +message MsgCreateVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount"; + + option (gogoproto.equal) = true; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // end of vesting as unix time (in seconds). + int64 end_time = 4; + bool delayed = 5; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse {} + +// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +// locked account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount"; + option (gogoproto.equal) = true; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccountResponse {} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePeriodicVestingAccount"; + + option (gogoproto.equal) = false; + + string from_address = 1; + string to_address = 2; + // start of vesting as unix time (in seconds). + int64 start_time = 3; + repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +// response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccountResponse {} diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto new file mode 100644 index 00000000..7ab1fb79 --- /dev/null +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// BaseVestingAccount implements the VestingAccount interface. It contains all +// the necessary fields needed for any vesting account implementation. +message BaseVestingAccount { + option (amino.name) = "cosmos-sdk/BaseVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Vesting end time, as unix timestamp (in seconds). + int64 end_time = 5; +} + +// ContinuousVestingAccount implements the VestingAccount interface. It +// continuously vests by unlocking coins linearly with respect to time. +message ContinuousVestingAccount { + option (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + // Vesting start time, as unix timestamp (in seconds). + int64 start_time = 2; +} + +// DelayedVestingAccount implements the VestingAccount interface. It vests all +// coins after a specific time, but non prior. In other words, it keeps them +// locked until a specified time. +message DelayedVestingAccount { + option (amino.name) = "cosmos-sdk/DelayedVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} + +// Period defines a length of time and amount of coins that will vest. +message Period { + option (gogoproto.goproto_stringer) = false; + + // Period duration in seconds. + int64 length = 1; + repeated cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// PeriodicVestingAccount implements the VestingAccount interface. It +// periodically vests by unlocking coins during each specified period. +message PeriodicVestingAccount { + option (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// PermanentLockedAccount implements the VestingAccount interface. It does +// not ever release coins, locking them indefinitely. Coins in this account can +// still be used for delegating and for governance votes even while locked. +// +// Since: cosmos-sdk 0.43 +message PermanentLockedAccount { + option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} diff --git a/proto/cosmos_proto/cosmos.proto b/proto/cosmos_proto/cosmos.proto new file mode 100644 index 00000000..5c63b86f --- /dev/null +++ b/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} diff --git a/proto/gogoproto/gogo.proto b/proto/gogoproto/gogo.proto new file mode 100644 index 00000000..974b36a7 --- /dev/null +++ b/proto/gogoproto/gogo.proto @@ -0,0 +1,145 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/cosmos/gogoproto +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/cosmos/gogoproto/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + + optional string castrepeated = 65013; +} diff --git a/proto/neutron/dex/deposit_record.proto b/proto/neutron/dex/deposit_record.proto new file mode 100644 index 00000000..f699d554 --- /dev/null +++ b/proto/neutron/dex/deposit_record.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "neutron/dex/pair_id.proto"; + +message DepositRecord { + PairID pair_id = 1; + string shares_owned = 2 [ + (gogoproto.moretags) = "yaml:\"shares_owned\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_owned" + ]; + int64 center_tick_index = 3; + int64 lower_tick_index = 4; + int64 upper_tick_index = 5; + uint64 fee = 6; +} diff --git a/proto/neutron/dex/limit_order_expiration.proto b/proto/neutron/dex/limit_order_expiration.proto new file mode 100644 index 00000000..0057de0d --- /dev/null +++ b/proto/neutron/dex/limit_order_expiration.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "google/protobuf/timestamp.proto"; + +import "gogoproto/gogo.proto"; + +message LimitOrderExpiration { + // see limitOrderTranche.proto for details on goodTilDate + google.protobuf.Timestamp expiration_time = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + bytes tranche_ref = 2; + +} + diff --git a/proto/neutron/dex/limit_order_tranche.proto b/proto/neutron/dex/limit_order_tranche.proto new file mode 100644 index 00000000..3bd70b1d --- /dev/null +++ b/proto/neutron/dex/limit_order_tranche.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "google/protobuf/timestamp.proto"; + +import "neutron/dex/trade_pair_id.proto"; +import "gogoproto/gogo.proto"; +import "neutron/dex/pair_id.proto"; + +message LimitOrderTrancheKey { + TradePairID trade_pair_id = 1; + int64 tick_index_taker_to_maker = 2; + string tranche_key = 3; +} + +message LimitOrderTranche { + LimitOrderTrancheKey key = 1; + string reserves_maker_denom = 2 [ + (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserves_maker_denom" + ]; + string reserves_taker_denom = 3 [ + (gogoproto.moretags) = "yaml:\"reserves_taker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserves_taker_denom" + ]; + string total_maker_denom = 4 [ + (gogoproto.moretags) = "yaml:\"total_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "total_maker_denom" + ]; + string total_taker_denom = 5 [ + (gogoproto.moretags) = "yaml:\"total_taker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "total_taker_denom" + ]; + // GoodTilDate is represented as seconds since January 1, year 1, 00:00:00.00 UTC + // LimitOrders with goodTilDate set are valid as long as blockTime <= goodTilDate + + // JIT orders also use goodTilDate to handle deletion but represent a special case + // All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live + // Order deletion still functions the same and the orders will be deleted at the end of the block + google.protobuf.Timestamp expiration_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; + string price_taker_to_maker = 7 [ + (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_taker_to_maker" + ]; +} + diff --git a/proto/neutron/dex/limit_order_tranche_user.proto b/proto/neutron/dex/limit_order_tranche_user.proto new file mode 100644 index 00000000..c8aade19 --- /dev/null +++ b/proto/neutron/dex/limit_order_tranche_user.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "neutron/dex/trade_pair_id.proto"; +import "neutron/dex/tx.proto"; + +message LimitOrderTrancheUser { + TradePairID trade_pair_id = 1; + int64 tick_index_taker_to_maker = 2; + string tranche_key = 3; + string address = 4; + string shares_owned = 5 [ + (gogoproto.moretags) = "yaml:\"shares_owned\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_owned" + ]; + string shares_withdrawn = 6 [ + (gogoproto.moretags) = "yaml:\"shares_withdrawn\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_withdrawn" + ]; + string shares_cancelled = 7 [ + (gogoproto.moretags) = "yaml:\"shares_cancelled\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_cancelled" + ]; + LimitOrderType order_type = 8; +} + diff --git a/proto/neutron/dex/pair_id.proto b/proto/neutron/dex/pair_id.proto new file mode 100644 index 00000000..e543ba7a --- /dev/null +++ b/proto/neutron/dex/pair_id.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; + +message PairID { + string token0 = 1; + string token1 = 2; +} diff --git a/proto/neutron/dex/params.proto b/proto/neutron/dex/params.proto new file mode 100644 index 00000000..70c65c29 --- /dev/null +++ b/proto/neutron/dex/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package neutron.dex; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + repeated uint64 fee_tiers = 1; +} diff --git a/proto/neutron/dex/pool.proto b/proto/neutron/dex/pool.proto new file mode 100644 index 00000000..5dd76a80 --- /dev/null +++ b/proto/neutron/dex/pool.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "neutron/dex/pool_reserves.proto"; + +// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool. + +message Pool { + uint64 id = 1; + PoolReserves lower_tick0 = 2; + PoolReserves upper_tick1 = 3; +} diff --git a/proto/neutron/dex/pool_metadata.proto b/proto/neutron/dex/pool_metadata.proto new file mode 100644 index 00000000..3e30323c --- /dev/null +++ b/proto/neutron/dex/pool_metadata.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; + +import "neutron/dex/pair_id.proto"; + +message PoolMetadata { + uint64 id = 1; + int64 tick = 2; + uint64 fee = 3; + PairID pair_id = 4; +} diff --git a/proto/neutron/dex/pool_reserves.proto b/proto/neutron/dex/pool_reserves.proto new file mode 100644 index 00000000..0d489ea9 --- /dev/null +++ b/proto/neutron/dex/pool_reserves.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "neutron/dex/trade_pair_id.proto"; + +message PoolReservesKey { + TradePairID trade_pair_id = 1; + int64 tick_index_taker_to_maker = 2; + uint64 fee = 3; +} + +message PoolReserves { + PoolReservesKey key = 1; + string reserves_maker_denom = 2 [ + (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.jsontag) = "reserves_maker_denom", + (gogoproto.nullable) = false + ]; + string price_taker_to_maker = 3 [ + (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_taker_to_maker" + ]; + string price_opposite_taker_to_maker = 4 [ + (gogoproto.moretags) = "yaml:\"price_opposite_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_opposite_taker_to_maker" + ]; +} + diff --git a/proto/neutron/dex/tick_liquidity.proto b/proto/neutron/dex/tick_liquidity.proto new file mode 100644 index 00000000..0671e8cf --- /dev/null +++ b/proto/neutron/dex/tick_liquidity.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "neutron/dex/limit_order_tranche.proto"; +import "neutron/dex/pool_reserves.proto"; + + +message TickLiquidity { + oneof liquidity { + PoolReserves pool_reserves = 1; + LimitOrderTranche limit_order_tranche = 2; + } + +} + diff --git a/proto/neutron/dex/trade_pair_id.proto b/proto/neutron/dex/trade_pair_id.proto new file mode 100644 index 00000000..c2f21e8d --- /dev/null +++ b/proto/neutron/dex/trade_pair_id.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package neutron.dex; + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; + +message TradePairID { + string maker_denom = 2; + string taker_denom = 3; +} diff --git a/proto/neutron/dex/tx.proto b/proto/neutron/dex/tx.proto new file mode 100644 index 00000000..41104299 --- /dev/null +++ b/proto/neutron/dex/tx.proto @@ -0,0 +1,209 @@ +syntax = "proto3"; +package neutron.dex; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/neutron-org/neutron/x/dex/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; +import "neutron/dex/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the Msg service. +service Msg { + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + rpc Withdrawal(MsgWithdrawal) returns (MsgWithdrawalResponse); + rpc PlaceLimitOrder(MsgPlaceLimitOrder) returns (MsgPlaceLimitOrderResponse); + rpc WithdrawFilledLimitOrder(MsgWithdrawFilledLimitOrder) returns (MsgWithdrawFilledLimitOrderResponse); + rpc CancelLimitOrder(MsgCancelLimitOrder) returns (MsgCancelLimitOrderResponse); + rpc MultiHopSwap(MsgMultiHopSwap) returns (MsgMultiHopSwapResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +// this line is used by starport scaffolding # proto/tx/rpc +} + +message DepositOptions { + bool disable_autoswap = 1; +} + +message MsgDeposit { + string creator = 1; + string receiver = 2; + string token_a = 3; + string token_b = 4; + repeated string amounts_a = 5 [ + (gogoproto.moretags) = "yaml:\"amounts_a\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amounts_a" + ]; + repeated string amounts_b = 6 [ + (gogoproto.moretags) = "yaml:\"amounts_b\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amounts_b" + ]; + repeated int64 tick_indexes_a_to_b = 7; + repeated uint64 fees = 8; + repeated DepositOptions options = 9; +} + +message MsgDepositResponse { + repeated string reserve0_deposited = 1 [ + (gogoproto.moretags) = "yaml:\"reserve0_deposited\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve0_deposited" + ]; + repeated string reserve1_deposited = 2[ + (gogoproto.moretags) = "yaml:\"reserve1_deposited\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve1_deposited" + ]; +} + +message MsgWithdrawal { + string creator = 1; + string receiver = 2; + string token_a = 3; + string token_b = 4; + repeated string shares_to_remove = 5 [ + (gogoproto.moretags) = "yaml:\"shares_to_remove\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_to_remove" + ]; + repeated int64 tick_indexes_a_to_b = 6; + repeated uint64 fees = 7; + +} + +message MsgWithdrawalResponse { +} + +enum LimitOrderType{ + GOOD_TIL_CANCELLED = 0; + FILL_OR_KILL = 1; + IMMEDIATE_OR_CANCEL = 2; + JUST_IN_TIME = 3; + GOOD_TIL_TIME = 4; +} + +message MsgPlaceLimitOrder { + string creator = 1; + string receiver = 2; + string token_in = 3; + string token_out = 4; + int64 tick_index_in_to_out = 5; + string amount_in = 7 [ + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" + ]; + LimitOrderType order_type = 8; + // expirationTime is only valid iff orderType == GOOD_TIL_TIME. + google.protobuf.Timestamp expiration_time = 9 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; + string max_amount_out = 10 [ + (gogoproto.moretags) = "yaml:\"max_amount_out\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "max_amount_out" + ]; +} + +message MsgPlaceLimitOrderResponse { + string trancheKey = 1; + // Total amount of coin used for the limit order + cosmos.base.v1beta1.Coin coin_in = 2 [ + (gogoproto.moretags) = "yaml:\"coin_in\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "coin_in" + ]; + // Total amount of coin received from the taker portion of the limit order + // This is the amount of coin immediately available in the users account after executing the + // limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + cosmos.base.v1beta1.Coin taker_coin_out = 3 [ + (gogoproto.moretags) = "yaml:\"taker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "taker_coin_out" + ]; + +} + +message MsgWithdrawFilledLimitOrder { + string creator = 1; + string tranche_key = 2; +} + +message MsgWithdrawFilledLimitOrderResponse { +} + +message MsgCancelLimitOrder { + string creator = 1; + string tranche_key = 2; +} + +message MsgCancelLimitOrderResponse { +} + +message MultiHopRoute { + repeated string hops = 1; +} + +message MsgMultiHopSwap { + string creator = 1; + string receiver = 2; + repeated MultiHopRoute routes = 3; + string amount_in = 4 [ + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" + ]; + string exit_limit_price = 5 [ + (gogoproto.moretags) = "yaml:\"exit_limit_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "exit_limit_price" + ]; + // If pickBestRoute == true then all routes are run and the route with the best price is chosen + // otherwise, the first succesful route is used. + bool pick_best_route = 6; +} + +message MsgMultiHopSwapResponse { + cosmos.base.v1beta1.Coin coin_out = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "coin_out" + ]; +} + +message MsgUpdateParams { + option (amino.name) = "dex/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.47 +message MsgUpdateParamsResponse {} + + +// this line is used by starport scaffolding # proto/tx/message diff --git a/proto/transfer/v1/transfer.proto b/proto/transfer/v1/transfer.proto index 572fe419..4ffe586f 100644 --- a/proto/transfer/v1/transfer.proto +++ b/proto/transfer/v1/transfer.proto @@ -7,6 +7,6 @@ package neutron.transfer; message MsgTransferResponse { // channel's sequence_id for outgoing ibc packet. Unique per a channel. uint64 sequence_id = 1; - // channel src channel on neutron side trasaction was submitted from + // channel src channel on neutron side transaction was submitted from string channel = 2; } From 1e4ed27a21dc64bc7881304ec1883272bd93a596 Mon Sep 17 00:00:00 2001 From: nhpd Date: Thu, 16 Nov 2023 18:19:17 +0400 Subject: [PATCH 30/77] add proto-build --- .gitmodules | 3 + Cargo.toml | 1 + neutron | 1 + packages/neutron-sdk/src/proto_types/bank.rs | 1378 -------- .../neutron-sdk/src/proto_types/cosmos.rs | 585 ---- .../src/proto_types/deposit_record.rs | 308 -- .../src/proto_types/dex/NEUTRON_COMMIT | 1 + .../neutron-sdk/src/proto_types/dex/amino.rs | 2 + .../proto_types/dex/cosmos.bank.v1beta1.rs | 106 + .../dex/cosmos.base.query.v1beta1.rs | 56 + .../proto_types/dex/cosmos.base.v1beta1.rs | 36 + .../src/proto_types/dex/cosmos.msg.v1.rs | 2 + .../proto_types/dex/cosmos.upgrade.v1beta1.rs | 75 + .../src/proto_types/dex/cosmos_proto.rs | 64 + .../dex/ibc.applications.transfer.v1.rs | 124 + .../dex/ibc.applications.transfer.v1.tonic.rs | 222 ++ .../proto_types/dex/ibc.core.channel.v1.rs | 207 ++ .../src/proto_types/dex/ibc.core.client.v1.rs | 102 + .../dex/neutron.contractmanager.rs | 89 + .../dex/neutron.contractmanager.tonic.rs | 277 ++ .../dex/neutron.contractmanager.v1.rs | 21 + .../src/proto_types/dex/neutron.cron.rs | 105 + .../src/proto_types/dex/neutron.cron.tonic.rs | 246 ++ .../src/proto_types/dex/neutron.dex.rs | 619 ++++ .../src/proto_types/dex/neutron.dex.tonic.rs | 668 ++++ .../src/proto_types/dex/neutron.feeburner.rs | 73 + .../dex/neutron.feeburner.tonic.rs | 238 ++ .../proto_types/dex/neutron.feerefunder.rs | 93 + .../dex/neutron.feerefunder.tonic.rs | 228 ++ .../dex/neutron.interchainqueries.rs | 290 ++ .../dex/neutron.interchainqueries.tonic.rs | 400 +++ .../proto_types/dex/neutron.interchaintxs.rs | 51 + .../dex/neutron.interchaintxs.tonic.rs | 131 + .../dex/neutron.interchaintxs.v1.rs | 72 + .../dex/neutron.interchaintxs.v1.tonic.rs | 150 + .../src/proto_types/dex/neutron.transfer.rs | 44 + .../proto_types/dex/neutron.transfer.tonic.rs | 296 ++ .../dex/osmosis.tokenfactory.v1beta1.rs | 230 ++ .../dex/osmosis.tokenfactory.v1beta1.tonic.rs | 435 +++ packages/neutron-sdk/src/proto_types/gogo.rs | 600 ---- .../src/proto_types/limit_order_expiration.rs | 221 -- .../src/proto_types/limit_order_tranche.rs | 550 --- .../proto_types/limit_order_tranche_user.rs | 366 -- packages/neutron-sdk/src/proto_types/mod.rs | 16 - .../neutron-sdk/src/proto_types/pair_id.rs | 210 -- .../neutron-sdk/src/proto_types/params.rs | 198 -- packages/neutron-sdk/src/proto_types/pool.rs | 241 -- .../src/proto_types/pool_metadata.rs | 256 -- .../src/proto_types/pool_reserves.rs | 452 --- .../src/proto_types/tick_liquidity.rs | 358 -- .../src/proto_types/trade_pair_id.rs | 211 -- packages/neutron-sdk/src/proto_types/tx.rs | 3002 ----------------- proto-build/Cargo.toml | 14 + proto-build/buf.neutron.gen.yaml | 8 + proto-build/src/main.rs | 315 ++ proto/amino.proto | 79 - proto/amino/amino.proto | 79 - .../cosmos/app/runtime/v1alpha1/module.proto | 50 - proto/cosmos/app/v1alpha1/config.proto | 55 - proto/cosmos/app/v1alpha1/module.proto | 91 - proto/cosmos/app/v1alpha1/query.proto | 22 - proto/cosmos/auth/module/v1/module.proto | 31 - proto/cosmos/auth/v1beta1/auth.proto | 58 - proto/cosmos/auth/v1beta1/genesis.proto | 18 - proto/cosmos/auth/v1beta1/query.proto | 236 -- proto/cosmos/auth/v1beta1/tx.proto | 43 - proto/cosmos/authz/module/v1/module.proto | 12 - proto/cosmos/authz/v1beta1/authz.proto | 48 - proto/cosmos/authz/v1beta1/event.proto | 27 - proto/cosmos/authz/v1beta1/genesis.proto | 14 - proto/cosmos/authz/v1beta1/query.proto | 82 - proto/cosmos/authz/v1beta1/tx.proto | 81 - proto/cosmos/autocli/v1/options.proto | 127 - proto/cosmos/autocli/v1/query.proto | 28 - proto/cosmos/bank/module/v1/module.proto | 20 - proto/cosmos/bank/v1beta1/authz.proto | 30 - proto/cosmos/bank/v1beta1/bank.proto | 124 - proto/cosmos/bank/v1beta1/genesis.proto | 52 - proto/cosmos/bank/v1beta1/query.proto | 348 -- proto/cosmos/bank/v1beta1/tx.proto | 122 - proto/cosmos/base/abci/v1beta1/abci.proto | 158 - proto/cosmos/base/kv/v1beta1/kv.proto | 17 - proto/cosmos/base/node/v1beta1/query.proto | 22 - .../base/query/v1beta1/pagination.proto | 56 - .../base/reflection/v1beta1/reflection.proto | 44 - .../base/reflection/v2alpha1/reflection.proto | 218 -- .../base/snapshots/v1beta1/snapshot.proto | 90 - .../base/store/v1beta1/commit_info.proto | 32 - .../cosmos/base/store/v1beta1/listening.proto | 34 - .../base/tendermint/v1beta1/query.proto | 208 -- .../base/tendermint/v1beta1/types.proto | 52 - proto/cosmos/base/v1beta1/coin.proto | 48 - .../cosmos/capability/module/v1/module.proto | 16 - .../capability/v1beta1/capability.proto | 31 - proto/cosmos/capability/v1beta1/genesis.proto | 27 - proto/cosmos/consensus/module/v1/module.proto | 15 - proto/cosmos/consensus/v1/query.proto | 27 - proto/cosmos/consensus/v1/tx.proto | 39 - proto/cosmos/crisis/module/v1/module.proto | 18 - proto/cosmos/crisis/v1beta1/genesis.proto | 15 - proto/cosmos/crisis/v1beta1/tx.proto | 65 - proto/cosmos/crypto/ed25519/keys.proto | 39 - proto/cosmos/crypto/hd/v1/hd.proto | 27 - proto/cosmos/crypto/keyring/v1/record.proto | 48 - proto/cosmos/crypto/multisig/keys.proto | 30 - .../crypto/multisig/v1beta1/multisig.proto | 25 - proto/cosmos/crypto/secp256k1/keys.proto | 38 - proto/cosmos/crypto/secp256r1/keys.proto | 23 - .../distribution/module/v1/module.proto | 17 - .../distribution/v1beta1/distribution.proto | 194 -- .../cosmos/distribution/v1beta1/genesis.proto | 155 - proto/cosmos/distribution/v1beta1/query.proto | 256 -- proto/cosmos/distribution/v1beta1/tx.proto | 178 - proto/cosmos/evidence/module/v1/module.proto | 12 - proto/cosmos/evidence/v1beta1/evidence.proto | 32 - proto/cosmos/evidence/v1beta1/genesis.proto | 12 - proto/cosmos/evidence/v1beta1/query.proto | 58 - proto/cosmos/evidence/v1beta1/tx.proto | 42 - proto/cosmos/feegrant/module/v1/module.proto | 12 - proto/cosmos/feegrant/v1beta1/feegrant.proto | 93 - proto/cosmos/feegrant/v1beta1/genesis.proto | 14 - proto/cosmos/feegrant/v1beta1/query.proto | 84 - proto/cosmos/feegrant/v1beta1/tx.proto | 57 - proto/cosmos/genutil/module/v1/module.proto | 12 - proto/cosmos/genutil/v1beta1/genesis.proto | 18 - proto/cosmos/gov/module/v1/module.proto | 19 - proto/cosmos/gov/v1/genesis.proto | 33 - proto/cosmos/gov/v1/gov.proto | 220 -- proto/cosmos/gov/v1/query.proto | 193 -- proto/cosmos/gov/v1/tx.proto | 172 - proto/cosmos/gov/v1beta1/genesis.proto | 30 - proto/cosmos/gov/v1beta1/gov.proto | 252 -- proto/cosmos/gov/v1beta1/query.proto | 194 -- proto/cosmos/gov/v1beta1/tx.proto | 138 - proto/cosmos/group/module/v1/module.proto | 24 - proto/cosmos/group/v1/events.proto | 94 - proto/cosmos/group/v1/genesis.proto | 39 - proto/cosmos/group/v1/query.proto | 320 -- proto/cosmos/group/v1/tx.proto | 394 --- proto/cosmos/group/v1/types.proto | 337 -- proto/cosmos/mint/module/v1/module.proto | 17 - proto/cosmos/mint/v1beta1/genesis.proto | 17 - proto/cosmos/mint/v1beta1/mint.proto | 59 - proto/cosmos/mint/v1beta1/query.proto | 65 - proto/cosmos/mint/v1beta1/tx.proto | 43 - proto/cosmos/msg/v1/msg.proto | 30 - proto/cosmos/nft/module/v1/module.proto | 12 - proto/cosmos/nft/v1beta1/event.proto | 43 - proto/cosmos/nft/v1beta1/genesis.proto | 24 - proto/cosmos/nft/v1beta1/nft.proto | 48 - proto/cosmos/nft/v1beta1/query.proto | 152 - proto/cosmos/nft/v1beta1/tx.proto | 34 - proto/cosmos/orm/module/v1alpha1/module.proto | 14 - proto/cosmos/orm/query/v1alpha1/query.proto | 131 - proto/cosmos/orm/v1/orm.proto | 104 - proto/cosmos/orm/v1alpha1/schema.proto | 76 - proto/cosmos/params/module/v1/module.proto | 12 - proto/cosmos/params/v1beta1/params.proto | 31 - proto/cosmos/params/v1beta1/query.proto | 63 - proto/cosmos/query/v1/query.proto | 35 - proto/cosmos/reflection/v1/reflection.proto | 27 - proto/cosmos/slashing/module/v1/module.proto | 15 - proto/cosmos/slashing/v1beta1/genesis.proto | 48 - proto/cosmos/slashing/v1beta1/query.proto | 66 - proto/cosmos/slashing/v1beta1/slashing.proto | 59 - proto/cosmos/slashing/v1beta1/tx.proto | 68 - proto/cosmos/staking/module/v1/module.proto | 20 - proto/cosmos/staking/v1beta1/authz.proto | 49 - proto/cosmos/staking/v1beta1/genesis.proto | 53 - proto/cosmos/staking/v1beta1/query.proto | 387 --- proto/cosmos/staking/v1beta1/staking.proto | 405 --- proto/cosmos/staking/v1beta1/tx.proto | 201 -- proto/cosmos/tx/config/v1/config.proto | 20 - proto/cosmos/tx/signing/v1beta1/signing.proto | 106 - proto/cosmos/tx/v1beta1/service.proto | 277 -- proto/cosmos/tx/v1beta1/tx.proto | 256 -- proto/cosmos/upgrade/module/v1/module.proto | 15 - proto/cosmos/upgrade/v1beta1/query.proto | 122 - proto/cosmos/upgrade/v1beta1/tx.proto | 62 - proto/cosmos/upgrade/v1beta1/upgrade.proto | 98 - proto/cosmos/vesting/module/v1/module.proto | 12 - proto/cosmos/vesting/v1beta1/tx.proto | 100 - proto/cosmos/vesting/v1beta1/vesting.proto | 97 - proto/cosmos_proto/cosmos.proto | 97 - proto/gogoproto/gogo.proto | 145 - proto/neutron/dex/deposit_record.proto | 20 - .../neutron/dex/limit_order_expiration.proto | 18 - proto/neutron/dex/limit_order_tranche.proto | 60 - .../dex/limit_order_tranche_user.proto | 34 - proto/neutron/dex/pair_id.proto | 9 - proto/neutron/dex/params.proto | 12 - proto/neutron/dex/pool.proto | 14 - proto/neutron/dex/pool_metadata.proto | 13 - proto/neutron/dex/pool_reserves.proto | 35 - proto/neutron/dex/tick_liquidity.proto | 17 - proto/neutron/dex/trade_pair_id.proto | 9 - proto/neutron/dex/tx.proto | 209 -- 197 files changed, 6095 insertions(+), 20261 deletions(-) create mode 100644 .gitmodules create mode 160000 neutron delete mode 100644 packages/neutron-sdk/src/proto_types/bank.rs delete mode 100644 packages/neutron-sdk/src/proto_types/cosmos.rs delete mode 100644 packages/neutron-sdk/src/proto_types/deposit_record.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT create mode 100644 packages/neutron-sdk/src/proto_types/dex/amino.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs create mode 100644 packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/gogo.rs delete mode 100644 packages/neutron-sdk/src/proto_types/limit_order_expiration.rs delete mode 100644 packages/neutron-sdk/src/proto_types/limit_order_tranche.rs delete mode 100644 packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs delete mode 100644 packages/neutron-sdk/src/proto_types/pair_id.rs delete mode 100644 packages/neutron-sdk/src/proto_types/params.rs delete mode 100644 packages/neutron-sdk/src/proto_types/pool.rs delete mode 100644 packages/neutron-sdk/src/proto_types/pool_metadata.rs delete mode 100644 packages/neutron-sdk/src/proto_types/pool_reserves.rs delete mode 100644 packages/neutron-sdk/src/proto_types/tick_liquidity.rs delete mode 100644 packages/neutron-sdk/src/proto_types/trade_pair_id.rs delete mode 100644 packages/neutron-sdk/src/proto_types/tx.rs create mode 100644 proto-build/Cargo.toml create mode 100644 proto-build/buf.neutron.gen.yaml create mode 100644 proto-build/src/main.rs delete mode 100644 proto/amino.proto delete mode 100644 proto/amino/amino.proto delete mode 100644 proto/cosmos/app/runtime/v1alpha1/module.proto delete mode 100644 proto/cosmos/app/v1alpha1/config.proto delete mode 100644 proto/cosmos/app/v1alpha1/module.proto delete mode 100644 proto/cosmos/app/v1alpha1/query.proto delete mode 100644 proto/cosmos/auth/module/v1/module.proto delete mode 100644 proto/cosmos/auth/v1beta1/auth.proto delete mode 100644 proto/cosmos/auth/v1beta1/genesis.proto delete mode 100644 proto/cosmos/auth/v1beta1/query.proto delete mode 100644 proto/cosmos/auth/v1beta1/tx.proto delete mode 100644 proto/cosmos/authz/module/v1/module.proto delete mode 100644 proto/cosmos/authz/v1beta1/authz.proto delete mode 100644 proto/cosmos/authz/v1beta1/event.proto delete mode 100644 proto/cosmos/authz/v1beta1/genesis.proto delete mode 100644 proto/cosmos/authz/v1beta1/query.proto delete mode 100644 proto/cosmos/authz/v1beta1/tx.proto delete mode 100644 proto/cosmos/autocli/v1/options.proto delete mode 100644 proto/cosmos/autocli/v1/query.proto delete mode 100644 proto/cosmos/bank/module/v1/module.proto delete mode 100644 proto/cosmos/bank/v1beta1/authz.proto delete mode 100644 proto/cosmos/bank/v1beta1/bank.proto delete mode 100644 proto/cosmos/bank/v1beta1/genesis.proto delete mode 100644 proto/cosmos/bank/v1beta1/query.proto delete mode 100644 proto/cosmos/bank/v1beta1/tx.proto delete mode 100644 proto/cosmos/base/abci/v1beta1/abci.proto delete mode 100644 proto/cosmos/base/kv/v1beta1/kv.proto delete mode 100644 proto/cosmos/base/node/v1beta1/query.proto delete mode 100644 proto/cosmos/base/query/v1beta1/pagination.proto delete mode 100644 proto/cosmos/base/reflection/v1beta1/reflection.proto delete mode 100644 proto/cosmos/base/reflection/v2alpha1/reflection.proto delete mode 100644 proto/cosmos/base/snapshots/v1beta1/snapshot.proto delete mode 100644 proto/cosmos/base/store/v1beta1/commit_info.proto delete mode 100644 proto/cosmos/base/store/v1beta1/listening.proto delete mode 100644 proto/cosmos/base/tendermint/v1beta1/query.proto delete mode 100644 proto/cosmos/base/tendermint/v1beta1/types.proto delete mode 100644 proto/cosmos/base/v1beta1/coin.proto delete mode 100644 proto/cosmos/capability/module/v1/module.proto delete mode 100644 proto/cosmos/capability/v1beta1/capability.proto delete mode 100644 proto/cosmos/capability/v1beta1/genesis.proto delete mode 100644 proto/cosmos/consensus/module/v1/module.proto delete mode 100644 proto/cosmos/consensus/v1/query.proto delete mode 100644 proto/cosmos/consensus/v1/tx.proto delete mode 100644 proto/cosmos/crisis/module/v1/module.proto delete mode 100644 proto/cosmos/crisis/v1beta1/genesis.proto delete mode 100644 proto/cosmos/crisis/v1beta1/tx.proto delete mode 100644 proto/cosmos/crypto/ed25519/keys.proto delete mode 100644 proto/cosmos/crypto/hd/v1/hd.proto delete mode 100644 proto/cosmos/crypto/keyring/v1/record.proto delete mode 100644 proto/cosmos/crypto/multisig/keys.proto delete mode 100644 proto/cosmos/crypto/multisig/v1beta1/multisig.proto delete mode 100644 proto/cosmos/crypto/secp256k1/keys.proto delete mode 100644 proto/cosmos/crypto/secp256r1/keys.proto delete mode 100644 proto/cosmos/distribution/module/v1/module.proto delete mode 100644 proto/cosmos/distribution/v1beta1/distribution.proto delete mode 100644 proto/cosmos/distribution/v1beta1/genesis.proto delete mode 100644 proto/cosmos/distribution/v1beta1/query.proto delete mode 100644 proto/cosmos/distribution/v1beta1/tx.proto delete mode 100644 proto/cosmos/evidence/module/v1/module.proto delete mode 100644 proto/cosmos/evidence/v1beta1/evidence.proto delete mode 100644 proto/cosmos/evidence/v1beta1/genesis.proto delete mode 100644 proto/cosmos/evidence/v1beta1/query.proto delete mode 100644 proto/cosmos/evidence/v1beta1/tx.proto delete mode 100644 proto/cosmos/feegrant/module/v1/module.proto delete mode 100644 proto/cosmos/feegrant/v1beta1/feegrant.proto delete mode 100644 proto/cosmos/feegrant/v1beta1/genesis.proto delete mode 100644 proto/cosmos/feegrant/v1beta1/query.proto delete mode 100644 proto/cosmos/feegrant/v1beta1/tx.proto delete mode 100644 proto/cosmos/genutil/module/v1/module.proto delete mode 100644 proto/cosmos/genutil/v1beta1/genesis.proto delete mode 100644 proto/cosmos/gov/module/v1/module.proto delete mode 100644 proto/cosmos/gov/v1/genesis.proto delete mode 100644 proto/cosmos/gov/v1/gov.proto delete mode 100644 proto/cosmos/gov/v1/query.proto delete mode 100644 proto/cosmos/gov/v1/tx.proto delete mode 100644 proto/cosmos/gov/v1beta1/genesis.proto delete mode 100644 proto/cosmos/gov/v1beta1/gov.proto delete mode 100644 proto/cosmos/gov/v1beta1/query.proto delete mode 100644 proto/cosmos/gov/v1beta1/tx.proto delete mode 100644 proto/cosmos/group/module/v1/module.proto delete mode 100644 proto/cosmos/group/v1/events.proto delete mode 100644 proto/cosmos/group/v1/genesis.proto delete mode 100644 proto/cosmos/group/v1/query.proto delete mode 100644 proto/cosmos/group/v1/tx.proto delete mode 100644 proto/cosmos/group/v1/types.proto delete mode 100644 proto/cosmos/mint/module/v1/module.proto delete mode 100644 proto/cosmos/mint/v1beta1/genesis.proto delete mode 100644 proto/cosmos/mint/v1beta1/mint.proto delete mode 100644 proto/cosmos/mint/v1beta1/query.proto delete mode 100644 proto/cosmos/mint/v1beta1/tx.proto delete mode 100644 proto/cosmos/msg/v1/msg.proto delete mode 100644 proto/cosmos/nft/module/v1/module.proto delete mode 100644 proto/cosmos/nft/v1beta1/event.proto delete mode 100644 proto/cosmos/nft/v1beta1/genesis.proto delete mode 100644 proto/cosmos/nft/v1beta1/nft.proto delete mode 100644 proto/cosmos/nft/v1beta1/query.proto delete mode 100644 proto/cosmos/nft/v1beta1/tx.proto delete mode 100644 proto/cosmos/orm/module/v1alpha1/module.proto delete mode 100644 proto/cosmos/orm/query/v1alpha1/query.proto delete mode 100644 proto/cosmos/orm/v1/orm.proto delete mode 100644 proto/cosmos/orm/v1alpha1/schema.proto delete mode 100644 proto/cosmos/params/module/v1/module.proto delete mode 100644 proto/cosmos/params/v1beta1/params.proto delete mode 100644 proto/cosmos/params/v1beta1/query.proto delete mode 100644 proto/cosmos/query/v1/query.proto delete mode 100644 proto/cosmos/reflection/v1/reflection.proto delete mode 100644 proto/cosmos/slashing/module/v1/module.proto delete mode 100644 proto/cosmos/slashing/v1beta1/genesis.proto delete mode 100644 proto/cosmos/slashing/v1beta1/query.proto delete mode 100644 proto/cosmos/slashing/v1beta1/slashing.proto delete mode 100644 proto/cosmos/slashing/v1beta1/tx.proto delete mode 100644 proto/cosmos/staking/module/v1/module.proto delete mode 100644 proto/cosmos/staking/v1beta1/authz.proto delete mode 100644 proto/cosmos/staking/v1beta1/genesis.proto delete mode 100644 proto/cosmos/staking/v1beta1/query.proto delete mode 100644 proto/cosmos/staking/v1beta1/staking.proto delete mode 100644 proto/cosmos/staking/v1beta1/tx.proto delete mode 100644 proto/cosmos/tx/config/v1/config.proto delete mode 100644 proto/cosmos/tx/signing/v1beta1/signing.proto delete mode 100644 proto/cosmos/tx/v1beta1/service.proto delete mode 100644 proto/cosmos/tx/v1beta1/tx.proto delete mode 100644 proto/cosmos/upgrade/module/v1/module.proto delete mode 100644 proto/cosmos/upgrade/v1beta1/query.proto delete mode 100644 proto/cosmos/upgrade/v1beta1/tx.proto delete mode 100644 proto/cosmos/upgrade/v1beta1/upgrade.proto delete mode 100644 proto/cosmos/vesting/module/v1/module.proto delete mode 100644 proto/cosmos/vesting/v1beta1/tx.proto delete mode 100644 proto/cosmos/vesting/v1beta1/vesting.proto delete mode 100644 proto/cosmos_proto/cosmos.proto delete mode 100644 proto/gogoproto/gogo.proto delete mode 100644 proto/neutron/dex/deposit_record.proto delete mode 100644 proto/neutron/dex/limit_order_expiration.proto delete mode 100644 proto/neutron/dex/limit_order_tranche.proto delete mode 100644 proto/neutron/dex/limit_order_tranche_user.proto delete mode 100644 proto/neutron/dex/pair_id.proto delete mode 100644 proto/neutron/dex/params.proto delete mode 100644 proto/neutron/dex/pool.proto delete mode 100644 proto/neutron/dex/pool_metadata.proto delete mode 100644 proto/neutron/dex/pool_reserves.proto delete mode 100644 proto/neutron/dex/tick_liquidity.proto delete mode 100644 proto/neutron/dex/trade_pair_id.proto delete mode 100644 proto/neutron/dex/tx.proto diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..afa0c8f3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "neutron"] + path = neutron + url = https://github.com/neutron-org/neutron.git diff --git a/Cargo.toml b/Cargo.toml index 956f2a3f..ddfffd84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["contracts/*", "packages/*"] +exclude = ["proto-build"] [profile.release] rpath = false diff --git a/neutron b/neutron new file mode 160000 index 00000000..83770b74 --- /dev/null +++ b/neutron @@ -0,0 +1 @@ +Subproject commit 83770b74d18b5f5e90c7b0514c7e13a0558af30a diff --git a/packages/neutron-sdk/src/proto_types/bank.rs b/packages/neutron-sdk/src/proto_types/bank.rs deleted file mode 100644 index 80abe2c1..00000000 --- a/packages/neutron-sdk/src/proto_types/bank.rs +++ /dev/null @@ -1,1378 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `cosmos/bank/v1beta1/bank.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -/// Params defines the parameters for the bank module. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Params) -pub struct Params { - // message fields - /// Deprecated: Use of SendEnabled in params is deprecated. - /// For genesis, use the newly added send_enabled field in the genesis object. - /// Storage, lookup, and manipulation of this information is now in the keeper. - /// - /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Params.send_enabled) - pub send_enabled: ::std::vec::Vec, - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Params.default_send_enabled) - pub default_send_enabled: bool, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Params.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Params { - fn default() -> &'a Params { - ::default_instance() - } -} - -impl Params { - pub fn new() -> Params { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "send_enabled", - |m: &Params| { &m.send_enabled }, - |m: &mut Params| { &mut m.send_enabled }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "default_send_enabled", - |m: &Params| { &m.default_send_enabled }, - |m: &mut Params| { &mut m.default_send_enabled }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Params", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Params { - const NAME: &'static str = "Params"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.send_enabled.push(is.read_message()?); - }, - 16 => { - self.default_send_enabled = is.read_bool()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - for value in &self.send_enabled { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - if self.default_send_enabled != false { - my_size += 1 + 1; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.send_enabled { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - }; - if self.default_send_enabled != false { - os.write_bool(2, self.default_send_enabled)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Params { - Params::new() - } - - fn clear(&mut self) { - self.send_enabled.clear(); - self.default_send_enabled = false; - self.special_fields.clear(); - } - - fn default_instance() -> &'static Params { - static instance: Params = Params { - send_enabled: ::std::vec::Vec::new(), - default_send_enabled: false, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Params { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Params").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Params { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Params { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// SendEnabled maps coin denom to a send_enabled status (whether a denom is -/// sendable). -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.SendEnabled) -pub struct SendEnabled { - // message fields - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.SendEnabled.denom) - pub denom: ::std::string::String, - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.SendEnabled.enabled) - pub enabled: bool, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.SendEnabled.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a SendEnabled { - fn default() -> &'a SendEnabled { - ::default_instance() - } -} - -impl SendEnabled { - pub fn new() -> SendEnabled { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "denom", - |m: &SendEnabled| { &m.denom }, - |m: &mut SendEnabled| { &mut m.denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "enabled", - |m: &SendEnabled| { &m.enabled }, - |m: &mut SendEnabled| { &mut m.enabled }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "SendEnabled", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for SendEnabled { - const NAME: &'static str = "SendEnabled"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.denom = is.read_string()?; - }, - 16 => { - self.enabled = is.read_bool()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.denom.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.denom); - } - if self.enabled != false { - my_size += 1 + 1; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.denom.is_empty() { - os.write_string(1, &self.denom)?; - } - if self.enabled != false { - os.write_bool(2, self.enabled)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> SendEnabled { - SendEnabled::new() - } - - fn clear(&mut self) { - self.denom.clear(); - self.enabled = false; - self.special_fields.clear(); - } - - fn default_instance() -> &'static SendEnabled { - static instance: SendEnabled = SendEnabled { - denom: ::std::string::String::new(), - enabled: false, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for SendEnabled { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("SendEnabled").unwrap()).clone() - } -} - -impl ::std::fmt::Display for SendEnabled { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SendEnabled { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// Input models transaction input. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Input) -pub struct Input { - // message fields - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Input.address) - pub address: ::std::string::String, - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Input.coins) - pub coins: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Input.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Input { - fn default() -> &'a Input { - ::default_instance() - } -} - -impl Input { - pub fn new() -> Input { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "address", - |m: &Input| { &m.address }, - |m: &mut Input| { &mut m.address }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "coins", - |m: &Input| { &m.coins }, - |m: &mut Input| { &mut m.coins }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Input", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Input { - const NAME: &'static str = "Input"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.address = is.read_string()?; - }, - 18 => { - self.coins.push(is.read_message()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.address.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.address); - } - for value in &self.coins { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.address.is_empty() { - os.write_string(1, &self.address)?; - } - for v in &self.coins { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Input { - Input::new() - } - - fn clear(&mut self) { - self.address.clear(); - self.coins.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Input { - static instance: Input = Input { - address: ::std::string::String::new(), - coins: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Input { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Input").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Input { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Input { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// Output models transaction outputs. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Output) -pub struct Output { - // message fields - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Output.address) - pub address: ::std::string::String, - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Output.coins) - pub coins: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Output.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Output { - fn default() -> &'a Output { - ::default_instance() - } -} - -impl Output { - pub fn new() -> Output { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "address", - |m: &Output| { &m.address }, - |m: &mut Output| { &mut m.address }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "coins", - |m: &Output| { &m.coins }, - |m: &mut Output| { &mut m.coins }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Output", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Output { - const NAME: &'static str = "Output"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.address = is.read_string()?; - }, - 18 => { - self.coins.push(is.read_message()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.address.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.address); - } - for value in &self.coins { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.address.is_empty() { - os.write_string(1, &self.address)?; - } - for v in &self.coins { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Output { - Output::new() - } - - fn clear(&mut self) { - self.address.clear(); - self.coins.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Output { - static instance: Output = Output { - address: ::std::string::String::new(), - coins: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Output { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Output").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Output { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Output { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// Supply represents a struct that passively keeps track of the total supply -/// amounts in the network. -/// This message is deprecated now that supply is indexed by denom. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Supply) -pub struct Supply { - // message fields - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Supply.total) - pub total: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Supply.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Supply { - fn default() -> &'a Supply { - ::default_instance() - } -} - -impl Supply { - pub fn new() -> Supply { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "total", - |m: &Supply| { &m.total }, - |m: &mut Supply| { &mut m.total }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Supply", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Supply { - const NAME: &'static str = "Supply"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.total.push(is.read_message()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - for value in &self.total { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.total { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Supply { - Supply::new() - } - - fn clear(&mut self) { - self.total.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Supply { - static instance: Supply = Supply { - total: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Supply { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Supply").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Supply { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Supply { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// DenomUnit represents a struct that describes a given -/// denomination unit of the basic token. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.DenomUnit) -pub struct DenomUnit { - // message fields - /// denom represents the string name of the given denom unit (e.g uatom). - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.denom) - pub denom: ::std::string::String, - /// exponent represents power of 10 exponent that one must - /// raise the base_denom to in order to equal the given DenomUnit's denom - /// 1 denom = 10^exponent base_denom - /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - /// exponent = 6, thus: 1 atom = 10^6 uatom). - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.exponent) - pub exponent: u32, - /// aliases is a list of string aliases for the given denom - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.DenomUnit.aliases) - pub aliases: ::std::vec::Vec<::std::string::String>, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.DenomUnit.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a DenomUnit { - fn default() -> &'a DenomUnit { - ::default_instance() - } -} - -impl DenomUnit { - pub fn new() -> DenomUnit { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "denom", - |m: &DenomUnit| { &m.denom }, - |m: &mut DenomUnit| { &mut m.denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "exponent", - |m: &DenomUnit| { &m.exponent }, - |m: &mut DenomUnit| { &mut m.exponent }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "aliases", - |m: &DenomUnit| { &m.aliases }, - |m: &mut DenomUnit| { &mut m.aliases }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "DenomUnit", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for DenomUnit { - const NAME: &'static str = "DenomUnit"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.denom = is.read_string()?; - }, - 16 => { - self.exponent = is.read_uint32()?; - }, - 26 => { - self.aliases.push(is.read_string()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.denom.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.denom); - } - if self.exponent != 0 { - my_size += ::protobuf::rt::uint32_size(2, self.exponent); - } - for value in &self.aliases { - my_size += ::protobuf::rt::string_size(3, &value); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.denom.is_empty() { - os.write_string(1, &self.denom)?; - } - if self.exponent != 0 { - os.write_uint32(2, self.exponent)?; - } - for v in &self.aliases { - os.write_string(3, &v)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> DenomUnit { - DenomUnit::new() - } - - fn clear(&mut self) { - self.denom.clear(); - self.exponent = 0; - self.aliases.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static DenomUnit { - static instance: DenomUnit = DenomUnit { - denom: ::std::string::String::new(), - exponent: 0, - aliases: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for DenomUnit { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("DenomUnit").unwrap()).clone() - } -} - -impl ::std::fmt::Display for DenomUnit { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DenomUnit { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// Metadata represents a struct that describes -/// a basic token. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos.bank.v1beta1.Metadata) -pub struct Metadata { - // message fields - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.description) - pub description: ::std::string::String, - /// denom_units represents the list of DenomUnit's for a given coin - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.denom_units) - pub denom_units: ::std::vec::Vec, - /// base represents the base denom (should be the DenomUnit with exponent = 0). - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.base) - pub base: ::std::string::String, - /// display indicates the suggested denom that should be - /// displayed in clients. - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.display) - pub display: ::std::string::String, - /// name defines the name of the token (eg: Cosmos Atom) - /// - /// Since: cosmos-sdk 0.43 - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.name) - pub name: ::std::string::String, - /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - /// be the same as the display. - /// - /// Since: cosmos-sdk 0.43 - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.symbol) - pub symbol: ::std::string::String, - /// URI to a document (on or off-chain) that contains additional information. Optional. - /// - /// Since: cosmos-sdk 0.46 - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.uri) - pub uri: ::std::string::String, - /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - /// the document didn't change. Optional. - /// - /// Since: cosmos-sdk 0.46 - // @@protoc_insertion_point(field:cosmos.bank.v1beta1.Metadata.uri_hash) - pub uri_hash: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:cosmos.bank.v1beta1.Metadata.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Metadata { - fn default() -> &'a Metadata { - ::default_instance() - } -} - -impl Metadata { - pub fn new() -> Metadata { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(8); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "description", - |m: &Metadata| { &m.description }, - |m: &mut Metadata| { &mut m.description }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "denom_units", - |m: &Metadata| { &m.denom_units }, - |m: &mut Metadata| { &mut m.denom_units }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "base", - |m: &Metadata| { &m.base }, - |m: &mut Metadata| { &mut m.base }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "display", - |m: &Metadata| { &m.display }, - |m: &mut Metadata| { &mut m.display }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "name", - |m: &Metadata| { &m.name }, - |m: &mut Metadata| { &mut m.name }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "symbol", - |m: &Metadata| { &m.symbol }, - |m: &mut Metadata| { &mut m.symbol }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "uri", - |m: &Metadata| { &m.uri }, - |m: &mut Metadata| { &mut m.uri }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "uri_hash", - |m: &Metadata| { &m.uri_hash }, - |m: &mut Metadata| { &mut m.uri_hash }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Metadata", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Metadata { - const NAME: &'static str = "Metadata"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.description = is.read_string()?; - }, - 18 => { - self.denom_units.push(is.read_message()?); - }, - 26 => { - self.base = is.read_string()?; - }, - 34 => { - self.display = is.read_string()?; - }, - 42 => { - self.name = is.read_string()?; - }, - 50 => { - self.symbol = is.read_string()?; - }, - 58 => { - self.uri = is.read_string()?; - }, - 66 => { - self.uri_hash = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.description); - } - for value in &self.denom_units { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - if !self.base.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.base); - } - if !self.display.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.display); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.name); - } - if !self.symbol.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.symbol); - } - if !self.uri.is_empty() { - my_size += ::protobuf::rt::string_size(7, &self.uri); - } - if !self.uri_hash.is_empty() { - my_size += ::protobuf::rt::string_size(8, &self.uri_hash); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.description.is_empty() { - os.write_string(1, &self.description)?; - } - for v in &self.denom_units { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - }; - if !self.base.is_empty() { - os.write_string(3, &self.base)?; - } - if !self.display.is_empty() { - os.write_string(4, &self.display)?; - } - if !self.name.is_empty() { - os.write_string(5, &self.name)?; - } - if !self.symbol.is_empty() { - os.write_string(6, &self.symbol)?; - } - if !self.uri.is_empty() { - os.write_string(7, &self.uri)?; - } - if !self.uri_hash.is_empty() { - os.write_string(8, &self.uri_hash)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Metadata { - Metadata::new() - } - - fn clear(&mut self) { - self.description.clear(); - self.denom_units.clear(); - self.base.clear(); - self.display.clear(); - self.name.clear(); - self.symbol.clear(); - self.uri.clear(); - self.uri_hash.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Metadata { - static instance: Metadata = Metadata { - description: ::std::string::String::new(), - denom_units: ::std::vec::Vec::new(), - base: ::std::string::String::new(), - display: ::std::string::String::new(), - name: ::std::string::String::new(), - symbol: ::std::string::String::new(), - uri: ::std::string::String::new(), - uri_hash: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Metadata { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Metadata").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Metadata { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Metadata { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1ecosmos/bank/v1beta1/bank.proto\x12\x13cosmos.bank.v1beta1\x1a\x14g\ - ogoproto/gogo.proto\x1a\x19cosmos_proto/cosmos.proto\x1a\x1ecosmos/base/\ - v1beta1/coin.proto\x1a\x17cosmos/msg/v1/msg.proto\x1a\x11amino/amino.pro\ - to\"\xa6\x01\n\x06Params\x12G\n\x0csend_enabled\x18\x01\x20\x03(\x0b2\ - \x20.cosmos.bank.v1beta1.SendEnabledR\x0bsendEnabledB\x02\x18\x01\x120\n\ - \x14default_send_enabled\x18\x02\x20\x01(\x08R\x12defaultSendEnabled:!\ - \x8a\xe7\xb0*\x18cosmos-sdk/x/bank/Params\x98\xa0\x1f\0\"G\n\x0bSendEnab\ - led\x12\x14\n\x05denom\x18\x01\x20\x01(\tR\x05denom\x12\x18\n\x07enabled\ - \x18\x02\x20\x01(\x08R\x07enabled:\x08\xe8\xa0\x1f\x01\x98\xa0\x1f\0\"\ - \xb9\x01\n\x05Input\x122\n\x07address\x18\x01\x20\x01(\tR\x07addressB\ - \x18\xd2\xb4-\x14cosmos.AddressString\x12f\n\x05coins\x18\x02\x20\x03(\ - \x0b2\x19.cosmos.base.v1beta1.CoinR\x05coinsB5\xaa\xdf\x1f(github.com/co\ - smos/cosmos-sdk/types.Coins\xc8\xde\x1f\0\xa8\xe7\xb0*\x01:\x14\x88\xa0\ - \x1f\0\xe8\xa0\x1f\0\x82\xe7\xb0*\x07address\"\xae\x01\n\x06Output\x122\ - \n\x07address\x18\x01\x20\x01(\tR\x07addressB\x18\xd2\xb4-\x14cosmos.Add\ - ressString\x12f\n\x05coins\x18\x02\x20\x03(\x0b2\x19.cosmos.base.v1beta1\ - .CoinR\x05coinsB5\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.Coins\ - \xc8\xde\x1f\0\xa8\xe7\xb0*\x01:\x08\x88\xa0\x1f\0\xe8\xa0\x1f\0\"\x9b\ - \x01\n\x06Supply\x12f\n\x05total\x18\x01\x20\x03(\x0b2\x19.cosmos.base.v\ - 1beta1.CoinR\x05totalB5\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.C\ - oins\xc8\xde\x1f\0\xa8\xe7\xb0*\x01:)\x18\x01\x88\xa0\x1f\0\xe8\xa0\x1f\ - \x01\xca\xb4-\x1bcosmos.bank.v1beta1.SupplyI\"W\n\tDenomUnit\x12\x14\n\ - \x05denom\x18\x01\x20\x01(\tR\x05denom\x12\x1a\n\x08exponent\x18\x02\x20\ - \x01(\rR\x08exponent\x12\x18\n\x07aliases\x18\x03\x20\x03(\tR\x07aliases\ - \"\x8a\x02\n\x08Metadata\x12\x20\n\x0bdescription\x18\x01\x20\x01(\tR\ - \x0bdescription\x12?\n\x0bdenom_units\x18\x02\x20\x03(\x0b2\x1e.cosmos.b\ - ank.v1beta1.DenomUnitR\ndenomUnits\x12\x12\n\x04base\x18\x03\x20\x01(\tR\ - \x04base\x12\x18\n\x07display\x18\x04\x20\x01(\tR\x07display\x12\x12\n\ - \x04name\x18\x05\x20\x01(\tR\x04name\x12\x16\n\x06symbol\x18\x06\x20\x01\ - (\tR\x06symbol\x12\x19\n\x03uri\x18\x07\x20\x01(\tR\x03uriB\x07\xe2\xde\ - \x1f\x03URI\x12&\n\x08uri_hash\x18\x08\x20\x01(\tR\x07uriHashB\x0b\xe2\ - \xde\x1f\x07URIHashB+Z)github.com/cosmos/cosmos-sdk/x/bank/typesJ\xa0\ - \x20\n\x06\x12\x04\0\0{\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\ - \x02\x12\x03\x01\0\x1c\n\t\n\x02\x03\0\x12\x03\x03\0\x1e\n\t\n\x02\x03\ - \x01\x12\x03\x04\0#\n\t\n\x02\x03\x02\x12\x03\x05\0(\n\t\n\x02\x03\x03\ - \x12\x03\x06\0!\n\t\n\x02\x03\x04\x12\x03\x07\0\x1b\n\x08\n\x01\x08\x12\ - \x03\t\0@\n\t\n\x02\x08\x0b\x12\x03\t\0@\n@\n\x02\x04\0\x12\x04\x0c\0\ - \x16\x01\x1a4\x20Params\x20defines\x20the\x20parameters\x20for\x20the\ - \x20bank\x20module.\n\n\n\n\x03\x04\0\x01\x12\x03\x0c\x08\x0e\n\n\n\x03\ - \x04\0\x07\x12\x03\r\x02C\n\x0e\n\x07\x04\0\x07\xf1\x8c\xa6\x05\x12\x03\ - \r\x02C\n\n\n\x03\x04\0\x07\x12\x03\x0e\x02.\n\r\n\x06\x04\0\x07\x83\xf4\ - \x03\x12\x03\x0e\x02.\n\xb8\x02\n\x04\x04\0\x02\0\x12\x03\x14\x02D\x1a\ - \xaa\x02\x20Deprecated:\x20Use\x20of\x20SendEnabled\x20in\x20params\x20i\ - s\x20deprecated.\n\x20For\x20genesis,\x20use\x20the\x20newly\x20added\ - \x20send_enabled\x20field\x20in\x20the\x20genesis\x20object.\n\x20Storag\ - e,\x20lookup,\x20and\x20manipulation\x20of\x20this\x20information\x20is\ - \x20now\x20in\x20the\x20keeper.\n\n\x20As\x20of\x20cosmos-sdk\x200.47,\ - \x20this\x20only\x20exists\x20for\x20backwards\x20compatibility\x20of\ - \x20genesis\x20files.\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x14\x02\n\n\ - \x0c\n\x05\x04\0\x02\0\x06\x12\x03\x14\x0b\x16\n\x0c\n\x05\x04\0\x02\0\ - \x01\x12\x03\x14\x17#\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x14./\n\x0c\n\ - \x05\x04\0\x02\0\x08\x12\x03\x140C\n\r\n\x06\x04\0\x02\0\x08\x03\x12\x03\ - \x141B\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x15\x020\n\x0c\n\x05\x04\0\x02\ - \x01\x05\x12\x03\x15\x02\x06\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x15\ - \x17+\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x15./\nb\n\x02\x04\x01\x12\ - \x04\x1a\0\x1f\x01\x1aV\x20SendEnabled\x20maps\x20coin\x20denom\x20to\ - \x20a\x20send_enabled\x20status\x20(whether\x20a\x20denom\x20is\n\x20sen\ - dable).\n\n\n\n\x03\x04\x01\x01\x12\x03\x1a\x08\x13\n\n\n\x03\x04\x01\ - \x07\x12\x03\x1b\x02-\n\r\n\x06\x04\x01\x07\x8d\xf4\x03\x12\x03\x1b\x02-\ - \n\n\n\x03\x04\x01\x07\x12\x03\x1c\x02.\n\r\n\x06\x04\x01\x07\x83\xf4\ - \x03\x12\x03\x1c\x02.\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x1d\x02*\n\x0c\n\ - \x05\x04\x01\x02\0\x05\x12\x03\x1d\x02\x08\n\x0c\n\x05\x04\x01\x02\0\x01\ - \x12\x03\x1d\t\x0e\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x1d()\n\x0b\n\ - \x04\x04\x01\x02\x01\x12\x03\x1e\x02*\n\x0c\n\x05\x04\x01\x02\x01\x05\ - \x12\x03\x1e\x02\x06\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x1e\t\x10\n\ - \x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x1e()\n-\n\x02\x04\x02\x12\x04\"\ - \0.\x01\x1a!\x20Input\x20models\x20transaction\x20input.\n\n\n\n\x03\x04\ - \x02\x01\x12\x03\"\x08\r\n\n\n\x03\x04\x02\x07\x12\x03#\x02,\n\x0f\n\x08\ - \x04\x02\x07\xf0\x8c\xa6\x05\0\x12\x03#\x02,\n\n\n\x03\x04\x02\x07\x12\ - \x03%\x02-\n\r\n\x06\x04\x02\x07\x8d\xf4\x03\x12\x03%\x02-\n\n\n\x03\x04\ - \x02\x07\x12\x03&\x02-\n\r\n\x06\x04\x02\x07\x81\xf4\x03\x12\x03&\x02-\n\ - \x0b\n\x04\x04\x02\x02\0\x12\x03(\x02_\n\x0c\n\x05\x04\x02\x02\0\x05\x12\ - \x03(\x02\x08\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03(\x0b\x12\n\x0c\n\x05\ - \x04\x02\x02\0\x03\x12\x03(,-\n\x0c\n\x05\x04\x02\x02\0\x08\x12\x03(.^\n\ - \x0f\n\x08\x04\x02\x02\0\x08\xca\xd6\x05\x12\x03(/]\n\x0c\n\x04\x04\x02\ - \x02\x01\x12\x04)\x02-\x04\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03)\x02\ - \n\n\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03)\x0b#\n\x0c\n\x05\x04\x02\x02\ - \x01\x01\x12\x03)$)\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03),-\n\r\n\x05\ - \x04\x02\x02\x01\x08\x12\x04).-\x03\n\x0f\n\x08\x04\x02\x02\x01\x08\xe9\ - \xfb\x03\x12\x03*\x04$\n\x10\n\t\x04\x02\x02\x01\x08\xf5\x8c\xa6\x05\x12\ - \x03+\x04#\n\x0f\n\x08\x04\x02\x02\x01\x08\xf5\xfb\x03\x12\x03,\x04I\n0\ - \n\x02\x04\x03\x12\x041\0;\x01\x1a$\x20Output\x20models\x20transaction\ - \x20outputs.\n\n\n\n\x03\x04\x03\x01\x12\x031\x08\x0e\n\n\n\x03\x04\x03\ - \x07\x12\x032\x02-\n\r\n\x06\x04\x03\x07\x8d\xf4\x03\x12\x032\x02-\n\n\n\ - \x03\x04\x03\x07\x12\x033\x02-\n\r\n\x06\x04\x03\x07\x81\xf4\x03\x12\x03\ - 3\x02-\n\x0b\n\x04\x04\x03\x02\0\x12\x035\x02_\n\x0c\n\x05\x04\x03\x02\0\ - \x05\x12\x035\x02\x08\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x035\x0b\x12\n\ - \x0c\n\x05\x04\x03\x02\0\x03\x12\x035,-\n\x0c\n\x05\x04\x03\x02\0\x08\ - \x12\x035.^\n\x0f\n\x08\x04\x03\x02\0\x08\xca\xd6\x05\x12\x035/]\n\x0c\n\ - \x04\x04\x03\x02\x01\x12\x046\x02:\x04\n\x0c\n\x05\x04\x03\x02\x01\x04\ - \x12\x036\x02\n\n\x0c\n\x05\x04\x03\x02\x01\x06\x12\x036\x0b#\n\x0c\n\ - \x05\x04\x03\x02\x01\x01\x12\x036$)\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\ - \x036,-\n\r\n\x05\x04\x03\x02\x01\x08\x12\x046.:\x03\n\x0f\n\x08\x04\x03\ - \x02\x01\x08\xe9\xfb\x03\x12\x037\x04$\n\x10\n\t\x04\x03\x02\x01\x08\xf5\ - \x8c\xa6\x05\x12\x038\x04#\n\x0f\n\x08\x04\x03\x02\x01\x08\xf5\xfb\x03\ - \x12\x039\x04I\n\xb2\x01\n\x02\x04\x04\x12\x04@\0M\x01\x1a\xa5\x01\x20Su\ - pply\x20represents\x20a\x20struct\x20that\x20passively\x20keeps\x20track\ - \x20of\x20the\x20total\x20supply\n\x20amounts\x20in\x20the\x20network.\n\ - \x20This\x20message\x20is\x20deprecated\x20now\x20that\x20supply\x20is\ - \x20indexed\x20by\x20denom.\n\n\n\n\x03\x04\x04\x01\x12\x03@\x08\x0e\n\n\ - \n\x03\x04\x04\x07\x12\x03A\x02\x1b\n\x0b\n\x04\x04\x04\x07\x03\x12\x03A\ - \x02\x1b\n\n\n\x03\x04\x04\x07\x12\x03C\x02,\n\r\n\x06\x04\x04\x07\x8d\ - \xf4\x03\x12\x03C\x02,\n\n\n\x03\x04\x04\x07\x12\x03D\x02-\n\r\n\x06\x04\ - \x04\x07\x81\xf4\x03\x12\x03D\x02-\n\n\n\x03\x04\x04\x07\x12\x03F\x02M\n\ - \x0e\n\x07\x04\x04\x07\xc9\xd6\x05\0\x12\x03F\x02M\n\x0c\n\x04\x04\x04\ - \x02\0\x12\x04H\x02L\x04\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03H\x02\n\n\ - \x0c\n\x05\x04\x04\x02\0\x06\x12\x03H\x0b#\n\x0c\n\x05\x04\x04\x02\0\x01\ - \x12\x03H$)\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03H,-\n\r\n\x05\x04\x04\ - \x02\0\x08\x12\x04H.L\x03\n\x0f\n\x08\x04\x04\x02\0\x08\xe9\xfb\x03\x12\ - \x03I\x04$\n\x10\n\t\x04\x04\x02\0\x08\xf5\x8c\xa6\x05\x12\x03J\x04#\n\ - \x0f\n\x08\x04\x04\x02\0\x08\xf5\xfb\x03\x12\x03K\x04I\ni\n\x02\x04\x05\ - \x12\x04Q\0\\\x01\x1a]\x20DenomUnit\x20represents\x20a\x20struct\x20that\ - \x20describes\x20a\x20given\n\x20denomination\x20unit\x20of\x20the\x20ba\ - sic\x20token.\n\n\n\n\x03\x04\x05\x01\x12\x03Q\x08\x11\nT\n\x04\x04\x05\ - \x02\0\x12\x03S\x02\x13\x1aG\x20denom\x20represents\x20the\x20string\x20\ - name\x20of\x20the\x20given\x20denom\x20unit\x20(e.g\x20uatom).\n\n\x0c\n\ - \x05\x04\x05\x02\0\x05\x12\x03S\x02\x08\n\x0c\n\x05\x04\x05\x02\0\x01\ - \x12\x03S\t\x0e\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03S\x11\x12\n\xa7\x02\ - \n\x04\x04\x05\x02\x01\x12\x03Y\x02\x16\x1a\x99\x02\x20exponent\x20repre\ - sents\x20power\x20of\x2010\x20exponent\x20that\x20one\x20must\n\x20raise\ - \x20the\x20base_denom\x20to\x20in\x20order\x20to\x20equal\x20the\x20give\ - n\x20DenomUnit's\x20denom\n\x201\x20denom\x20=\x2010^exponent\x20base_de\ - nom\n\x20(e.g.\x20with\x20a\x20base_denom\x20of\x20uatom,\x20one\x20can\ - \x20create\x20a\x20DenomUnit\x20of\x20'atom'\x20with\n\x20exponent\x20=\ - \x206,\x20thus:\x201\x20atom\x20=\x2010^6\x20uatom).\n\n\x0c\n\x05\x04\ - \x05\x02\x01\x05\x12\x03Y\x02\x08\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\ - \x03Y\t\x11\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03Y\x14\x15\nF\n\x04\ - \x04\x05\x02\x02\x12\x03[\x02\x1e\x1a9\x20aliases\x20is\x20a\x20list\x20\ - of\x20string\x20aliases\x20for\x20the\x20given\x20denom\n\n\x0c\n\x05\ - \x04\x05\x02\x02\x04\x12\x03[\x02\n\n\x0c\n\x05\x04\x05\x02\x02\x05\x12\ - \x03[\x0b\x11\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\x03[\x12\x19\n\x0c\n\ - \x05\x04\x05\x02\x02\x03\x12\x03[\x1c\x1d\nI\n\x02\x04\x06\x12\x04`\0{\ - \x01\x1a=\x20Metadata\x20represents\x20a\x20struct\x20that\x20describes\ - \n\x20a\x20basic\x20token.\n\n\n\n\x03\x04\x06\x01\x12\x03`\x08\x10\n\ - \x0b\n\x04\x04\x06\x02\0\x12\x03a\x02\x19\n\x0c\n\x05\x04\x06\x02\0\x05\ - \x12\x03a\x02\x08\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03a\t\x14\n\x0c\n\ - \x05\x04\x06\x02\0\x03\x12\x03a\x17\x18\nN\n\x04\x04\x06\x02\x01\x12\x03\ - c\x02%\x1aA\x20denom_units\x20represents\x20the\x20list\x20of\x20DenomUn\ - it's\x20for\x20a\x20given\x20coin\n\n\x0c\n\x05\x04\x06\x02\x01\x04\x12\ - \x03c\x02\n\n\x0c\n\x05\x04\x06\x02\x01\x06\x12\x03c\x0b\x14\n\x0c\n\x05\ - \x04\x06\x02\x01\x01\x12\x03c\x15\x20\n\x0c\n\x05\x04\x06\x02\x01\x03\ - \x12\x03c#$\nZ\n\x04\x04\x06\x02\x02\x12\x03e\x02\x12\x1aM\x20base\x20re\ - presents\x20the\x20base\x20denom\x20(should\x20be\x20the\x20DenomUnit\ - \x20with\x20exponent\x20=\x200).\n\n\x0c\n\x05\x04\x06\x02\x02\x05\x12\ - \x03e\x02\x08\n\x0c\n\x05\x04\x06\x02\x02\x01\x12\x03e\t\r\n\x0c\n\x05\ - \x04\x06\x02\x02\x03\x12\x03e\x10\x11\nZ\n\x04\x04\x06\x02\x03\x12\x03h\ - \x02\x15\x1aM\x20display\x20indicates\x20the\x20suggested\x20denom\x20th\ - at\x20should\x20be\n\x20displayed\x20in\x20clients.\n\n\x0c\n\x05\x04\ - \x06\x02\x03\x05\x12\x03h\x02\x08\n\x0c\n\x05\x04\x06\x02\x03\x01\x12\ - \x03h\t\x10\n\x0c\n\x05\x04\x06\x02\x03\x03\x12\x03h\x13\x14\n\\\n\x04\ - \x04\x06\x02\x04\x12\x03l\x02\x12\x1aO\x20name\x20defines\x20the\x20name\ - \x20of\x20the\x20token\x20(eg:\x20Cosmos\x20Atom)\n\n\x20Since:\x20cosmo\ - s-sdk\x200.43\n\n\x0c\n\x05\x04\x06\x02\x04\x05\x12\x03l\x02\x08\n\x0c\n\ - \x05\x04\x06\x02\x04\x01\x12\x03l\t\r\n\x0c\n\x05\x04\x06\x02\x04\x03\ - \x12\x03l\x10\x11\n\x90\x01\n\x04\x04\x06\x02\x05\x12\x03q\x02\x14\x1a\ - \x82\x01\x20symbol\x20is\x20the\x20token\x20symbol\x20usually\x20shown\ - \x20on\x20exchanges\x20(eg:\x20ATOM).\x20This\x20can\n\x20be\x20the\x20s\ - ame\x20as\x20the\x20display.\n\n\x20Since:\x20cosmos-sdk\x200.43\n\n\x0c\ - \n\x05\x04\x06\x02\x05\x05\x12\x03q\x02\x08\n\x0c\n\x05\x04\x06\x02\x05\ - \x01\x12\x03q\t\x0f\n\x0c\n\x05\x04\x06\x02\x05\x03\x12\x03q\x12\x13\n{\ - \n\x04\x04\x06\x02\x06\x12\x03u\x022\x1an\x20URI\x20to\x20a\x20document\ - \x20(on\x20or\x20off-chain)\x20that\x20contains\x20additional\x20informa\ - tion.\x20Optional.\n\n\x20Since:\x20cosmos-sdk\x200.46\n\n\x0c\n\x05\x04\ - \x06\x02\x06\x05\x12\x03u\x02\x08\n\x0c\n\x05\x04\x06\x02\x06\x01\x12\ - \x03u\t\x0c\n\x0c\n\x05\x04\x06\x02\x06\x03\x12\x03u\x0f\x10\n\x0c\n\x05\ - \x04\x06\x02\x06\x08\x12\x03u\x111\n\x0f\n\x08\x04\x06\x02\x06\x08\xec\ - \xfb\x03\x12\x03u\x120\n\x9f\x01\n\x04\x04\x06\x02\x07\x12\x03z\x02;\x1a\ - \x91\x01\x20URIHash\x20is\x20a\x20sha256\x20hash\x20of\x20a\x20document\ - \x20pointed\x20by\x20URI.\x20It's\x20used\x20to\x20verify\x20that\n\x20t\ - he\x20document\x20didn't\x20change.\x20Optional.\n\n\x20Since:\x20cosmos\ - -sdk\x200.46\n\n\x0c\n\x05\x04\x06\x02\x07\x05\x12\x03z\x02\x08\n\x0c\n\ - \x05\x04\x06\x02\x07\x01\x12\x03z\t\x11\n\x0c\n\x05\x04\x06\x02\x07\x03\ - \x12\x03z\x14\x15\n\x0c\n\x05\x04\x06\x02\x07\x08\x12\x03z\x16:\n\x0f\n\ - \x08\x04\x06\x02\x07\x08\xec\xfb\x03\x12\x03z\x179b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(5); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::cosmos::file_descriptor().clone()); - deps.push(super::coin::file_descriptor().clone()); - deps.push(super::msg::file_descriptor().clone()); - deps.push(super::amino::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(7); - messages.push(Params::generated_message_descriptor_data()); - messages.push(SendEnabled::generated_message_descriptor_data()); - messages.push(Input::generated_message_descriptor_data()); - messages.push(Output::generated_message_descriptor_data()); - messages.push(Supply::generated_message_descriptor_data()); - messages.push(DenomUnit::generated_message_descriptor_data()); - messages.push(Metadata::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/cosmos.rs b/packages/neutron-sdk/src/proto_types/cosmos.rs deleted file mode 100644 index 2cc0fa48..00000000 --- a/packages/neutron-sdk/src/proto_types/cosmos.rs +++ /dev/null @@ -1,585 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `cosmos_proto/cosmos.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -/// InterfaceDescriptor describes an interface type to be used with -/// accepts_interface and implements_interface and declared by declare_interface. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos_proto.InterfaceDescriptor) -pub struct InterfaceDescriptor { - // message fields - /// name is the name of the interface. It should be a short-name (without - /// a period) such that the fully qualified name of the interface will be - /// package.name, ex. for the package a.b and interface named C, the - /// fully-qualified name will be a.b.C. - // @@protoc_insertion_point(field:cosmos_proto.InterfaceDescriptor.name) - pub name: ::std::string::String, - /// description is a human-readable description of the interface and its - /// purpose. - // @@protoc_insertion_point(field:cosmos_proto.InterfaceDescriptor.description) - pub description: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:cosmos_proto.InterfaceDescriptor.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a InterfaceDescriptor { - fn default() -> &'a InterfaceDescriptor { - ::default_instance() - } -} - -impl InterfaceDescriptor { - pub fn new() -> InterfaceDescriptor { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "name", - |m: &InterfaceDescriptor| { &m.name }, - |m: &mut InterfaceDescriptor| { &mut m.name }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "description", - |m: &InterfaceDescriptor| { &m.description }, - |m: &mut InterfaceDescriptor| { &mut m.description }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "InterfaceDescriptor", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for InterfaceDescriptor { - const NAME: &'static str = "InterfaceDescriptor"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.name = is.read_string()?; - }, - 18 => { - self.description = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.description); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.description.is_empty() { - os.write_string(2, &self.description)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> InterfaceDescriptor { - InterfaceDescriptor::new() - } - - fn clear(&mut self) { - self.name.clear(); - self.description.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static InterfaceDescriptor { - static instance: InterfaceDescriptor = InterfaceDescriptor { - name: ::std::string::String::new(), - description: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for InterfaceDescriptor { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("InterfaceDescriptor").unwrap()).clone() - } -} - -impl ::std::fmt::Display for InterfaceDescriptor { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for InterfaceDescriptor { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// ScalarDescriptor describes an scalar type to be used with -/// the scalar field option and declared by declare_scalar. -/// Scalars extend simple protobuf built-in types with additional -/// syntax and semantics, for instance to represent big integers. -/// Scalars should ideally define an encoding such that there is only one -/// valid syntactical representation for a given semantic meaning, -/// i.e. the encoding should be deterministic. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:cosmos_proto.ScalarDescriptor) -pub struct ScalarDescriptor { - // message fields - /// name is the name of the scalar. It should be a short-name (without - /// a period) such that the fully qualified name of the scalar will be - /// package.name, ex. for the package a.b and scalar named C, the - /// fully-qualified name will be a.b.C. - // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.name) - pub name: ::std::string::String, - /// description is a human-readable description of the scalar and its - /// encoding format. For instance a big integer or decimal scalar should - /// specify precisely the expected encoding format. - // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.description) - pub description: ::std::string::String, - /// field_type is the type of field with which this scalar can be used. - /// Scalars can be used with one and only one type of field so that - /// encoding standards and simple and clear. Currently only string and - /// bytes fields are supported for scalars. - // @@protoc_insertion_point(field:cosmos_proto.ScalarDescriptor.field_type) - pub field_type: ::std::vec::Vec<::protobuf::EnumOrUnknown>, - // special fields - // @@protoc_insertion_point(special_field:cosmos_proto.ScalarDescriptor.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a ScalarDescriptor { - fn default() -> &'a ScalarDescriptor { - ::default_instance() - } -} - -impl ScalarDescriptor { - pub fn new() -> ScalarDescriptor { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "name", - |m: &ScalarDescriptor| { &m.name }, - |m: &mut ScalarDescriptor| { &mut m.name }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "description", - |m: &ScalarDescriptor| { &m.description }, - |m: &mut ScalarDescriptor| { &mut m.description }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "field_type", - |m: &ScalarDescriptor| { &m.field_type }, - |m: &mut ScalarDescriptor| { &mut m.field_type }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "ScalarDescriptor", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for ScalarDescriptor { - const NAME: &'static str = "ScalarDescriptor"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.name = is.read_string()?; - }, - 18 => { - self.description = is.read_string()?; - }, - 24 => { - self.field_type.push(is.read_enum_or_unknown()?); - }, - 26 => { - ::protobuf::rt::read_repeated_packed_enum_or_unknown_into(is, &mut self.field_type)? - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.description); - } - for value in &self.field_type { - my_size += ::protobuf::rt::int32_size(3, value.value()); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.description.is_empty() { - os.write_string(2, &self.description)?; - } - for v in &self.field_type { - os.write_enum(3, ::protobuf::EnumOrUnknown::value(v))?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> ScalarDescriptor { - ScalarDescriptor::new() - } - - fn clear(&mut self) { - self.name.clear(); - self.description.clear(); - self.field_type.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static ScalarDescriptor { - static instance: ScalarDescriptor = ScalarDescriptor { - name: ::std::string::String::new(), - description: ::std::string::String::new(), - field_type: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for ScalarDescriptor { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("ScalarDescriptor").unwrap()).clone() - } -} - -impl ::std::fmt::Display for ScalarDescriptor { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ScalarDescriptor { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] -// @@protoc_insertion_point(enum:cosmos_proto.ScalarType) -pub enum ScalarType { - // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_UNSPECIFIED) - SCALAR_TYPE_UNSPECIFIED = 0, - // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_STRING) - SCALAR_TYPE_STRING = 1, - // @@protoc_insertion_point(enum_value:cosmos_proto.ScalarType.SCALAR_TYPE_BYTES) - SCALAR_TYPE_BYTES = 2, -} - -impl ::protobuf::Enum for ScalarType { - const NAME: &'static str = "ScalarType"; - - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_UNSPECIFIED), - 1 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_STRING), - 2 => ::std::option::Option::Some(ScalarType::SCALAR_TYPE_BYTES), - _ => ::std::option::Option::None - } - } - - const VALUES: &'static [ScalarType] = &[ - ScalarType::SCALAR_TYPE_UNSPECIFIED, - ScalarType::SCALAR_TYPE_STRING, - ScalarType::SCALAR_TYPE_BYTES, - ]; -} - -impl ::protobuf::EnumFull for ScalarType { - fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().enum_by_package_relative_name("ScalarType").unwrap()).clone() - } - - fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { - let index = *self as usize; - Self::enum_descriptor().value_by_index(index) - } -} - -impl ::std::default::Default for ScalarType { - fn default() -> Self { - ScalarType::SCALAR_TYPE_UNSPECIFIED - } -} - -impl ScalarType { - fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { - ::protobuf::reflect::GeneratedEnumDescriptorData::new::("ScalarType") - } -} - -/// Extension fields -pub mod exts { - - pub const implements_interface: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::MessageOptions, ::std::string::String> = ::protobuf::ext::ExtFieldRepeated::new(93001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const accepts_interface: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(93001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const scalar: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(93002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const declare_interface: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::FileOptions, super::InterfaceDescriptor> = ::protobuf::ext::ExtFieldRepeated::new(793021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_MESSAGE); - - pub const declare_scalar: ::protobuf::ext::ExtFieldRepeated<::protobuf::descriptor::FileOptions, super::ScalarDescriptor> = ::protobuf::ext::ExtFieldRepeated::new(793022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_MESSAGE); -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x19cosmos_proto/cosmos.proto\x12\x0ccosmos_proto\x1a\x20google/protob\ - uf/descriptor.proto\"K\n\x13InterfaceDescriptor\x12\x12\n\x04name\x18\ - \x01\x20\x01(\tR\x04name\x12\x20\n\x0bdescription\x18\x02\x20\x01(\tR\ - \x0bdescription\"\x81\x01\n\x10ScalarDescriptor\x12\x12\n\x04name\x18\ - \x01\x20\x01(\tR\x04name\x12\x20\n\x0bdescription\x18\x02\x20\x01(\tR\ - \x0bdescription\x127\n\nfield_type\x18\x03\x20\x03(\x0e2\x18.cosmos_prot\ - o.ScalarTypeR\tfieldType*X\n\nScalarType\x12\x1b\n\x17SCALAR_TYPE_UNSPEC\ - IFIED\x10\0\x12\x16\n\x12SCALAR_TYPE_STRING\x10\x01\x12\x15\n\x11SCALAR_\ - TYPE_BYTES\x10\x02:T\n\x14implements_interface\x18\xc9\xd6\x05\x20\x03(\ - \t\x12\x1f.google.protobuf.MessageOptionsR\x13implementsInterface:L\n\ - \x11accepts_interface\x18\xc9\xd6\x05\x20\x01(\t\x12\x1d.google.protobuf\ - .FieldOptionsR\x10acceptsInterface:7\n\x06scalar\x18\xca\xd6\x05\x20\x01\ - (\t\x12\x1d.google.protobuf.FieldOptionsR\x06scalar:n\n\x11declare_inter\ - face\x18\xbd\xb30\x20\x03(\x0b2!.cosmos_proto.InterfaceDescriptor\x12\ - \x1c.google.protobuf.FileOptionsR\x10declareInterface:e\n\x0edeclare_sca\ - lar\x18\xbe\xb30\x20\x03(\x0b2\x1e.cosmos_proto.ScalarDescriptor\x12\x1c\ - .google.protobuf.FileOptionsR\rdeclareScalarB-Z+github.com/cosmos/cosmos\ - -proto;cosmos_protoJ\xb0\x1f\n\x06\x12\x04\0\0`\x01\n\x08\n\x01\x0c\x12\ - \x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x15\n\t\n\x02\x03\0\x12\x03\ - \x03\0*\n\x08\n\x01\x08\x12\x03\x05\0B\n\t\n\x02\x08\x0b\x12\x03\x05\0B\ - \n\t\n\x01\x07\x12\x04\x07\0\x0f\x01\n\xb6\x02\n\x02\x07\0\x12\x03\x0e\ - \x041\x1a\xaa\x02\x20implements_interface\x20is\x20used\x20to\x20indicat\ - e\x20the\x20type\x20name\x20of\x20the\x20interface\n\x20that\x20a\x20mes\ - sage\x20implements\x20so\x20that\x20it\x20can\x20be\x20used\x20in\x20goo\ - gle.protobuf.Any\n\x20fields\x20that\x20accept\x20that\x20interface.\x20\ - A\x20message\x20can\x20implement\x20multiple\n\x20interfaces.\x20Interfa\ - ces\x20should\x20be\x20declared\x20using\x20a\x20declare_interface\n\x20\ - file\x20option.\n\n\n\n\x03\x07\0\x02\x12\x03\x07\x07%\n\n\n\x03\x07\0\ - \x04\x12\x03\x0e\x04\x0c\n\n\n\x03\x07\0\x05\x12\x03\x0e\r\x13\n\n\n\x03\ - \x07\0\x01\x12\x03\x0e\x14(\n\n\n\x03\x07\0\x03\x12\x03\x0e+0\n\t\n\x01\ - \x07\x12\x04\x11\0\x1d\x01\n\xd4\x01\n\x02\x07\x01\x12\x03\x16\x04%\x1a\ - \xc8\x01\x20accepts_interface\x20is\x20used\x20to\x20annotate\x20that\ - \x20a\x20google.protobuf.Any\n\x20field\x20accepts\x20messages\x20that\ - \x20implement\x20the\x20specified\x20interface.\n\x20Interfaces\x20shoul\ - d\x20be\x20declared\x20using\x20a\x20declare_interface\x20file\x20option\ - .\n\n\n\n\x03\x07\x01\x02\x12\x03\x11\x07#\n\n\n\x03\x07\x01\x05\x12\x03\ - \x16\x04\n\n\n\n\x03\x07\x01\x01\x12\x03\x16\x0b\x1c\n\n\n\x03\x07\x01\ - \x03\x12\x03\x16\x1f$\n\x96\x02\n\x02\x07\x02\x12\x03\x1c\x04\x1a\x1a\ - \x8a\x02\x20scalar\x20is\x20used\x20to\x20indicate\x20that\x20this\x20fi\ - eld\x20follows\x20the\x20formatting\x20defined\n\x20by\x20the\x20named\ - \x20scalar\x20which\x20should\x20be\x20declared\x20with\x20declare_scala\ - r.\x20Code\n\x20generators\x20may\x20choose\x20to\x20use\x20this\x20info\ - rmation\x20to\x20map\x20this\x20field\x20to\x20a\n\x20language-specific\ - \x20type\x20representing\x20the\x20scalar.\n\n\n\n\x03\x07\x02\x02\x12\ - \x03\x11\x07#\n\n\n\x03\x07\x02\x05\x12\x03\x1c\x04\n\n\n\n\x03\x07\x02\ - \x01\x12\x03\x1c\x0b\x11\n\n\n\x03\x07\x02\x03\x12\x03\x1c\x14\x19\n\t\n\ - \x01\x07\x12\x04\x1f\00\x01\n\x91\x03\n\x02\x07\x03\x12\x03'\x04<\x1a\ - \x85\x03\x20declare_interface\x20declares\x20an\x20interface\x20type\x20\ - to\x20be\x20used\x20with\n\x20accepts_interface\x20and\x20implements_int\ - erface.\x20Interface\x20names\x20are\n\x20expected\x20to\x20follow\x20th\ - e\x20following\x20convention\x20such\x20that\x20their\x20declaration\n\ - \x20can\x20be\x20discovered\x20by\x20tools:\x20for\x20a\x20given\x20inte\ - rface\x20type\x20a.b.C,\x20it\x20is\n\x20expected\x20that\x20the\x20decl\ - aration\x20will\x20be\x20found\x20in\x20a\x20protobuf\x20file\x20named\n\ - \x20a/b/interfaces.proto\x20in\x20the\x20file\x20descriptor\x20set.\n\n\ - \n\n\x03\x07\x03\x02\x12\x03\x1f\x07\"\n\n\n\x03\x07\x03\x04\x12\x03'\ - \x04\x0c\n\n\n\x03\x07\x03\x06\x12\x03'\r\x20\n\n\n\x03\x07\x03\x01\x12\ - \x03'!2\n\n\n\x03\x07\x03\x03\x12\x03'5;\n\xee\x02\n\x02\x07\x04\x12\x03\ - /\x046\x1a\xe2\x02\x20declare_scalar\x20declares\x20a\x20scalar\x20type\ - \x20to\x20be\x20used\x20with\n\x20the\x20scalar\x20field\x20option.\x20S\ - calar\x20names\x20are\n\x20expected\x20to\x20follow\x20the\x20following\ - \x20convention\x20such\x20that\x20their\x20declaration\n\x20can\x20be\ - \x20discovered\x20by\x20tools:\x20for\x20a\x20given\x20scalar\x20type\ - \x20a.b.C,\x20it\x20is\n\x20expected\x20that\x20the\x20declaration\x20wi\ - ll\x20be\x20found\x20in\x20a\x20protobuf\x20file\x20named\n\x20a/b/scala\ - rs.proto\x20in\x20the\x20file\x20descriptor\x20set.\n\n\n\n\x03\x07\x04\ - \x02\x12\x03\x1f\x07\"\n\n\n\x03\x07\x04\x04\x12\x03/\x04\x0c\n\n\n\x03\ - \x07\x04\x06\x12\x03/\r\x1d\n\n\n\x03\x07\x04\x01\x12\x03/\x1e,\n\n\n\ - \x03\x07\x04\x03\x12\x03//5\n\x9d\x01\n\x02\x04\0\x12\x044\0?\x01\x1a\ - \x90\x01\x20InterfaceDescriptor\x20describes\x20an\x20interface\x20type\ - \x20to\x20be\x20used\x20with\n\x20accepts_interface\x20and\x20implements\ - _interface\x20and\x20declared\x20by\x20declare_interface.\n\n\n\n\x03\ - \x04\0\x01\x12\x034\x08\x1b\n\x83\x02\n\x04\x04\0\x02\0\x12\x03:\x04\x14\ - \x1a\xf5\x01\x20name\x20is\x20the\x20name\x20of\x20the\x20interface.\x20\ - It\x20should\x20be\x20a\x20short-name\x20(without\n\x20a\x20period)\x20s\ - uch\x20that\x20the\x20fully\x20qualified\x20name\x20of\x20the\x20interfa\ - ce\x20will\x20be\n\x20package.name,\x20ex.\x20for\x20the\x20package\x20a\ - .b\x20and\x20interface\x20named\x20C,\x20the\n\x20fully-qualified\x20nam\ - e\x20will\x20be\x20a.b.C.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03:\x04\n\n\ - \x0c\n\x05\x04\0\x02\0\x01\x12\x03:\x0b\x0f\n\x0c\n\x05\x04\0\x02\0\x03\ - \x12\x03:\x12\x13\n]\n\x04\x04\0\x02\x01\x12\x03>\x04\x1b\x1aP\x20descri\ - ption\x20is\x20a\x20human-readable\x20description\x20of\x20the\x20interf\ - ace\x20and\x20its\n\x20purpose.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03>\ - \x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03>\x0b\x16\n\x0c\n\x05\x04\0\ - \x02\x01\x03\x12\x03>\x19\x1a\n\xb2\x03\n\x02\x04\x01\x12\x04H\0Z\x01\ - \x1a\xa5\x03\x20ScalarDescriptor\x20describes\x20an\x20scalar\x20type\ - \x20to\x20be\x20used\x20with\n\x20the\x20scalar\x20field\x20option\x20an\ - d\x20declared\x20by\x20declare_scalar.\n\x20Scalars\x20extend\x20simple\ - \x20protobuf\x20built-in\x20types\x20with\x20additional\n\x20syntax\x20a\ - nd\x20semantics,\x20for\x20instance\x20to\x20represent\x20big\x20integer\ - s.\n\x20Scalars\x20should\x20ideally\x20define\x20an\x20encoding\x20such\ - \x20that\x20there\x20is\x20only\x20one\n\x20valid\x20syntactical\x20repr\ - esentation\x20for\x20a\x20given\x20semantic\x20meaning,\n\x20i.e.\x20the\ - \x20encoding\x20should\x20be\x20deterministic.\n\n\n\n\x03\x04\x01\x01\ - \x12\x03H\x08\x18\n\xfa\x01\n\x04\x04\x01\x02\0\x12\x03N\x04\x14\x1a\xec\ - \x01\x20name\x20is\x20the\x20name\x20of\x20the\x20scalar.\x20It\x20shoul\ - d\x20be\x20a\x20short-name\x20(without\n\x20a\x20period)\x20such\x20that\ - \x20the\x20fully\x20qualified\x20name\x20of\x20the\x20scalar\x20will\x20\ - be\n\x20package.name,\x20ex.\x20for\x20the\x20package\x20a.b\x20and\x20s\ - calar\x20named\x20C,\x20the\n\x20fully-qualified\x20name\x20will\x20be\ - \x20a.b.C.\n\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03N\x04\n\n\x0c\n\x05\ - \x04\x01\x02\0\x01\x12\x03N\x0b\x0f\n\x0c\n\x05\x04\x01\x02\0\x03\x12\ - \x03N\x12\x13\n\xc8\x01\n\x04\x04\x01\x02\x01\x12\x03S\x04\x1b\x1a\xba\ - \x01\x20description\x20is\x20a\x20human-readable\x20description\x20of\ - \x20the\x20scalar\x20and\x20its\n\x20encoding\x20format.\x20For\x20insta\ - nce\x20a\x20big\x20integer\x20or\x20decimal\x20scalar\x20should\n\x20spe\ - cify\x20precisely\x20the\x20expected\x20encoding\x20format.\n\n\x0c\n\ - \x05\x04\x01\x02\x01\x05\x12\x03S\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\ - \x12\x03S\x0b\x16\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03S\x19\x1a\n\x81\ - \x02\n\x04\x04\x01\x02\x02\x12\x03Y\x04'\x1a\xf3\x01\x20field_type\x20is\ - \x20the\x20type\x20of\x20field\x20with\x20which\x20this\x20scalar\x20can\ - \x20be\x20used.\n\x20Scalars\x20can\x20be\x20used\x20with\x20one\x20and\ - \x20only\x20one\x20type\x20of\x20field\x20so\x20that\n\x20encoding\x20st\ - andards\x20and\x20simple\x20and\x20clear.\x20Currently\x20only\x20string\ - \x20and\n\x20bytes\x20fields\x20are\x20supported\x20for\x20scalars.\n\n\ - \x0c\n\x05\x04\x01\x02\x02\x04\x12\x03Y\x04\x0c\n\x0c\n\x05\x04\x01\x02\ - \x02\x06\x12\x03Y\r\x17\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03Y\x18\"\n\ - \x0c\n\x05\x04\x01\x02\x02\x03\x12\x03Y%&\n\n\n\x02\x05\0\x12\x04\\\0`\ - \x01\n\n\n\x03\x05\0\x01\x12\x03\\\x05\x0f\n\x0b\n\x04\x05\0\x02\0\x12\ - \x03]\x04\x20\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03]\x04\x1b\n\x0c\n\x05\ - \x05\0\x02\0\x02\x12\x03]\x1e\x1f\n\x0b\n\x04\x05\0\x02\x01\x12\x03^\x04\ - \x1b\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03^\x04\x16\n\x0c\n\x05\x05\0\ - \x02\x01\x02\x12\x03^\x19\x1a\n\x0b\n\x04\x05\0\x02\x02\x12\x03_\x04\x1a\ - \n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03_\x04\x15\n\x0c\n\x05\x05\0\x02\ - \x02\x02\x12\x03_\x18\x19b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(1); - deps.push(::protobuf::descriptor::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(2); - messages.push(InterfaceDescriptor::generated_message_descriptor_data()); - messages.push(ScalarDescriptor::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(1); - enums.push(ScalarType::generated_enum_descriptor_data()); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/deposit_record.rs b/packages/neutron-sdk/src/proto_types/deposit_record.rs deleted file mode 100644 index 273b0c3e..00000000 --- a/packages/neutron-sdk/src/proto_types/deposit_record.rs +++ /dev/null @@ -1,308 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/deposit_record.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.DepositRecord) -pub struct DepositRecord { - // message fields - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.pair_id) - pub pair_id: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.shares_owned) - pub shares_owned: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.center_tick_index) - pub center_tick_index: i64, - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.lower_tick_index) - pub lower_tick_index: i64, - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.upper_tick_index) - pub upper_tick_index: i64, - // @@protoc_insertion_point(field:neutron.dex.DepositRecord.fee) - pub fee: u64, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.DepositRecord.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a DepositRecord { - fn default() -> &'a DepositRecord { - ::default_instance() - } -} - -impl DepositRecord { - pub fn new() -> DepositRecord { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(6); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pair_id::PairID>( - "pair_id", - |m: &DepositRecord| { &m.pair_id }, - |m: &mut DepositRecord| { &mut m.pair_id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "shares_owned", - |m: &DepositRecord| { &m.shares_owned }, - |m: &mut DepositRecord| { &mut m.shares_owned }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "center_tick_index", - |m: &DepositRecord| { &m.center_tick_index }, - |m: &mut DepositRecord| { &mut m.center_tick_index }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "lower_tick_index", - |m: &DepositRecord| { &m.lower_tick_index }, - |m: &mut DepositRecord| { &mut m.lower_tick_index }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "upper_tick_index", - |m: &DepositRecord| { &m.upper_tick_index }, - |m: &mut DepositRecord| { &mut m.upper_tick_index }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "fee", - |m: &DepositRecord| { &m.fee }, - |m: &mut DepositRecord| { &mut m.fee }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "DepositRecord", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for DepositRecord { - const NAME: &'static str = "DepositRecord"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.pair_id)?; - }, - 18 => { - self.shares_owned = is.read_string()?; - }, - 24 => { - self.center_tick_index = is.read_int64()?; - }, - 32 => { - self.lower_tick_index = is.read_int64()?; - }, - 40 => { - self.upper_tick_index = is.read_int64()?; - }, - 48 => { - self.fee = is.read_uint64()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.pair_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.shares_owned.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.shares_owned); - } - if self.center_tick_index != 0 { - my_size += ::protobuf::rt::int64_size(3, self.center_tick_index); - } - if self.lower_tick_index != 0 { - my_size += ::protobuf::rt::int64_size(4, self.lower_tick_index); - } - if self.upper_tick_index != 0 { - my_size += ::protobuf::rt::int64_size(5, self.upper_tick_index); - } - if self.fee != 0 { - my_size += ::protobuf::rt::uint64_size(6, self.fee); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.pair_id.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if !self.shares_owned.is_empty() { - os.write_string(2, &self.shares_owned)?; - } - if self.center_tick_index != 0 { - os.write_int64(3, self.center_tick_index)?; - } - if self.lower_tick_index != 0 { - os.write_int64(4, self.lower_tick_index)?; - } - if self.upper_tick_index != 0 { - os.write_int64(5, self.upper_tick_index)?; - } - if self.fee != 0 { - os.write_uint64(6, self.fee)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> DepositRecord { - DepositRecord::new() - } - - fn clear(&mut self) { - self.pair_id.clear(); - self.shares_owned.clear(); - self.center_tick_index = 0; - self.lower_tick_index = 0; - self.upper_tick_index = 0; - self.fee = 0; - self.special_fields.clear(); - } - - fn default_instance() -> &'static DepositRecord { - static instance: DepositRecord = DepositRecord { - pair_id: ::protobuf::MessageField::none(), - shares_owned: ::std::string::String::new(), - center_tick_index: 0, - lower_tick_index: 0, - upper_tick_index: 0, - fee: 0, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for DepositRecord { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("DepositRecord").unwrap()).clone() - } -} - -impl ::std::fmt::Display for DepositRecord { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DepositRecord { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x20neutron/dex/deposit_record.proto\x12\x0bneutron.dex\x1a\x14gogopro\ - to/gogo.proto\x1a\x19neutron/dex/pair_id.proto\"\xc9\x02\n\rDepositRecor\ - d\x12,\n\x07pair_id\x18\x01\x20\x01(\x0b2\x13.neutron.dex.PairIDR\x06pai\ - rId\x12x\n\x0cshares_owned\x18\x02\x20\x01(\tR\x0bsharesOwnedBU\xf2\xde\ - \x1f\x13yaml:\"shares_owned\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/t\ - ypes.Int\xc8\xde\x1f\0\xea\xde\x1f\x0cshares_owned\x12*\n\x11center_tick\ - _index\x18\x03\x20\x01(\x03R\x0fcenterTickIndex\x12(\n\x10lower_tick_ind\ - ex\x18\x04\x20\x01(\x03R\x0elowerTickIndex\x12(\n\x10upper_tick_index\ - \x18\x05\x20\x01(\x03R\x0eupperTickIndex\x12\x10\n\x03fee\x18\x06\x20\ - \x01(\x04R\x03feeB,Z*github.com/neutron-org/neutron/x/dex/typesJ\xfd\x03\ - \n\x06\x12\x04\0\0\x13\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\ - \x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\ - \x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\ - \x03\x05\0#\n\n\n\x02\x04\0\x12\x04\x07\0\x13\x01\n\n\n\x03\x04\0\x01\ - \x12\x03\x07\x08\x15\n\x0b\n\x04\x04\0\x02\0\x12\x03\x08\x02\x15\n\x0c\n\ - \x05\x04\0\x02\0\x06\x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\ - \x03\x08\t\x10\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x13\x14\n\x0c\n\ - \x04\x04\0\x02\x01\x12\x04\t\x02\x0e\x1c\n\x0c\n\x05\x04\0\x02\x01\x05\ - \x12\x03\t\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\t\t\x15\n\x0c\n\ - \x05\x04\0\x02\x01\x03\x12\x03\t\x18\x19\n\r\n\x05\x04\0\x02\x01\x08\x12\ - \x04\t\x1a\x0e\x1b\n\x0f\n\x08\x04\0\x02\x01\x08\xee\xfb\x03\x12\x03\n\ - \x1aJ\n\x0f\n\x08\x04\0\x02\x01\x08\xeb\xfb\x03\x12\x03\x0b\x1a[\n\x0f\n\ - \x08\x04\0\x02\x01\x08\xe9\xfb\x03\x12\x03\x0c\x1a8\n\x0f\n\x08\x04\0\ - \x02\x01\x08\xed\xfb\x03\x12\x03\r\x1a>\n\x0b\n\x04\x04\0\x02\x02\x12\ - \x03\x0f\x02\x1e\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x0f\x02\x07\n\x0c\ - \n\x05\x04\0\x02\x02\x01\x12\x03\x0f\x08\x19\n\x0c\n\x05\x04\0\x02\x02\ - \x03\x12\x03\x0f\x1c\x1d\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x10\x02\x1d\n\ - \x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x10\x02\x07\n\x0c\n\x05\x04\0\x02\ - \x03\x01\x12\x03\x10\x08\x18\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x10\ - \x1b\x1c\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x11\x02\x1d\n\x0c\n\x05\x04\0\ - \x02\x04\x05\x12\x03\x11\x02\x07\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\ - \x11\x08\x18\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x11\x1b\x1c\n\x0b\n\ - \x04\x04\0\x02\x05\x12\x03\x12\x02\x11\n\x0c\n\x05\x04\0\x02\x05\x05\x12\ - \x03\x12\x02\x08\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x12\t\x0c\n\x0c\n\ - \x05\x04\0\x02\x05\x03\x12\x03\x12\x0f\x10b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::pair_id::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(DepositRecord::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT new file mode 100644 index 00000000..8febfb61 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT @@ -0,0 +1 @@ +83770b74d18b5f5e90c7b0514c7e13a0558af30a \ No newline at end of file diff --git a/packages/neutron-sdk/src/proto_types/dex/amino.rs b/packages/neutron-sdk/src/proto_types/dex/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs new file mode 100644 index 00000000..6e98a26f --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs @@ -0,0 +1,106 @@ +// @generated +/// Params defines the parameters for the bank module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + #[deprecated] + #[prost(message, repeated, tag = "1")] + pub send_enabled: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "2")] + pub default_send_enabled: bool, +} +/// SendEnabled maps coin denom to a send_enabled status (whether a denom is +/// sendable). +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SendEnabled { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub enabled: bool, +} +/// Input models transaction input. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Input { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Output models transaction outputs. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Output { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Supply represents a struct that passively keeps track of the total supply +/// amounts in the network. +/// This message is deprecated now that supply is indexed by denom. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Supply { + #[prost(message, repeated, tag = "1")] + pub total: ::prost::alloc::vec::Vec, +} +/// DenomUnit represents a struct that describes a given +/// denomination unit of the basic token. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenomUnit { + /// denom represents the string name of the given denom unit (e.g uatom). + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// exponent represents power of 10 exponent that one must + /// raise the base_denom to in order to equal the given DenomUnit's denom + /// 1 denom = 10^exponent base_denom + /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + /// exponent = 6, thus: 1 atom = 10^6 uatom). + #[prost(uint32, tag = "2")] + pub exponent: u32, + /// aliases is a list of string aliases for the given denom + #[prost(string, repeated, tag = "3")] + pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Metadata represents a struct that describes +/// a basic token. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Metadata { + #[prost(string, tag = "1")] + pub description: ::prost::alloc::string::String, + /// denom_units represents the list of DenomUnit's for a given coin + #[prost(message, repeated, tag = "2")] + pub denom_units: ::prost::alloc::vec::Vec, + /// base represents the base denom (should be the DenomUnit with exponent = 0). + #[prost(string, tag = "3")] + pub base: ::prost::alloc::string::String, + /// display indicates the suggested denom that should be + /// displayed in clients. + #[prost(string, tag = "4")] + pub display: ::prost::alloc::string::String, + /// name defines the name of the token (eg: Cosmos Atom) + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "5")] + pub name: ::prost::alloc::string::String, + /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + /// be the same as the display. + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "6")] + pub symbol: ::prost::alloc::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "7")] + pub uri: ::prost::alloc::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "8")] + pub uri_hash: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs new file mode 100644 index 00000000..f37d3872 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs @@ -0,0 +1,56 @@ +// @generated +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageRequest { + /// key is a value returned in PageResponse.next_key to begin + /// querying the next page most efficiently. Only one of offset or key + /// should be set. + #[prost(bytes = "vec", tag = "1")] + pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. + #[prost(uint64, tag = "2")] + pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag = "3")] + pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// is set. + #[prost(bool, tag = "4")] + pub count_total: bool, + /// reverse is set to true if results are to be returned in the descending order. + /// + /// Since: cosmos-sdk 0.43 + #[prost(bool, tag = "5")] + pub reverse: bool, +} +/// PageResponse is to be embedded in gRPC response messages where the +/// corresponding request message has used PageRequest. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageResponse { + /// next_key is the key to be passed to PageRequest.key to + /// query the next page most efficiently. It will be empty if + /// there are no more results. + #[prost(bytes = "vec", tag = "1")] + pub next_key: ::prost::alloc::vec::Vec, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + #[prost(uint64, tag = "2")] + pub total: u64, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..cc4421b2 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs @@ -0,0 +1,36 @@ +// @generated +/// Coin defines a token with a denomination and an amount. +/// +/// NOTE: The amount field is an Int which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Coin { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub amount: ::prost::alloc::string::String, +} +/// DecCoin defines a token with a denomination and a decimal amount. +/// +/// NOTE: The amount field is an Dec which implements the custom method +/// signatures required by gogoproto. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecCoin { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub amount: ::prost::alloc::string::String, +} +/// IntProto defines a Protobuf wrapper around an Int object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IntProto { + #[prost(string, tag = "1")] + pub int: ::prost::alloc::string::String, +} +/// DecProto defines a Protobuf wrapper around a Dec object. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecProto { + #[prost(string, tag = "1")] + pub dec: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs new file mode 100644 index 00000000..e400b37a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs @@ -0,0 +1,75 @@ +// @generated +/// Plan specifies information about a planned upgrade and when it should occur. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Plan { + /// Sets the name for the upgrade. This name will be used by the upgraded + /// version of the software to apply any special "on-upgrade" commands during + /// the first BeginBlock method after the upgrade is applied. It is also used + /// to detect whether a software version can handle a given upgrade. If no + /// upgrade handler with this name has been set in the software, it will be + /// assumed that the software is out-of-date when the upgrade Time or Height is + /// reached and the software will exit. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + /// has been removed from the SDK. + /// If this field is not empty, an error will be thrown. + #[deprecated] + #[prost(message, optional, tag = "2")] + pub time: ::core::option::Option<::prost_types::Timestamp>, + /// The height at which the upgrade must be performed. + #[prost(int64, tag = "3")] + pub height: i64, + /// Any application specific upgrade info to be included on-chain + /// such as a git commit that validators could automatically upgrade to + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + /// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + /// moved to the IBC module in the sub module 02-client. + /// If this field is not empty, an error will be thrown. + #[deprecated] + #[prost(message, optional, tag = "5")] + pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, +} +/// SoftwareUpgradeProposal is a gov Content type for initiating a software +/// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgSoftwareUpgrade. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SoftwareUpgradeProposal { + /// title of the proposal + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// plan of the proposal + #[prost(message, optional, tag = "3")] + pub plan: ::core::option::Option, +} +/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +/// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgCancelUpgrade. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CancelSoftwareUpgradeProposal { + /// title of the proposal + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ModuleVersion specifies a module and its consensus version. +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleVersion { + /// name of the app module + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// consensus version of the app module + #[prost(uint64, tag = "2")] + pub version: u64, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs b/packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs new file mode 100644 index 00000000..a74f2b1e --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs @@ -0,0 +1,64 @@ +// @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// 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 { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs b/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs new file mode 100644 index 00000000..13bad6fc --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs @@ -0,0 +1,124 @@ +// @generated +/// DenomTrace contains the base denomination for ICS20 fungible tokens and the +/// source tracing information path. +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +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, +} +/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +/// method +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +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 +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +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 +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[prost(string, tag = "1")] + pub escrow_address: ::prost::alloc::string::String, +} +/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomResponse { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, +} +include!("ibc.applications.transfer.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs new file mode 100644 index 00000000..b29aa84e --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs @@ -0,0 +1,222 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn denom_traces( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/DenomTraces", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "DenomTraces", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denom_trace( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/DenomTrace", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "DenomTrace", + )); + self.inner.unary(req, path, codec).await + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "Params", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denom_hash( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/DenomHash", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "DenomHash", + )); + self.inner.unary(req, path, codec).await + } + pub async fn escrow_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/EscrowAddress", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "EscrowAddress", + )); + self.inner.unary(req, path, codec).await + } + pub async fn total_escrow_for_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "TotalEscrowForDenom", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs b/packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs new file mode 100644 index 00000000..825d1a9f --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs @@ -0,0 +1,207 @@ +// @generated +/// 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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Channel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + 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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IdentifiedChannel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + 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")] + pub port_id: ::prost::alloc::string::String, + /// channel identifier + #[prost(string, tag = "7")] + pub channel_id: ::prost::alloc::string::String, +} +/// Counterparty defines a channel end counterparty +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Counterparty { + /// port on the counterparty chain which owns the other end of the channel. + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel end on the counterparty chain + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// Packet defines a type that carries data across different chains through IBC +#[derive(Clone, PartialEq, ::prost::Message)] +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")] + 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")] + 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")] + 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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketState { + /// channel port identifier. + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier. + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence. + #[prost(uint64, tag = "3")] + pub sequence: u64, + /// embedded data that represents packet state. + #[prost(bytes = "vec", tag = "4")] + 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 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketId { + /// channel port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + 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: +/// +#[derive(Clone, PartialEq, ::prost::Message)] +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 { + /// response contains either a result or an error and must be non-empty + #[derive(Clone, PartialEq, ::prost::Oneof)] + 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)] +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", + } + } +} +/// Order defines if a channel is ORDERED or UNORDERED +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +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", + } + } +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs b/packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs new file mode 100644 index 00000000..cade23bd --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs @@ -0,0 +1,102 @@ +// @generated +/// IdentifiedClientState defines a client state with an additional client +/// identifier field. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IdentifiedClientState { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// client state + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option<::prost_types::Any>, +} +/// ConsensusStateWithHeight defines a consensus state with an additional height +/// field. +#[derive(Clone, PartialEq, ::prost::Message)] +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<::prost_types::Any>, +} +/// ClientConsensusStates defines all the stored consensus states for a given +/// client. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientConsensusStates { + /// client identifier + #[prost(string, tag = "1")] + 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). +#[derive(Clone, PartialEq, ::prost::Message)] +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")] + 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")] + pub substitute_client_id: ::prost::alloc::string::String, +} +/// UpgradeProposal is a gov Content type for initiating an IBC breaking +/// upgrade. +#[derive(Clone, PartialEq, ::prost::Message)] +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<::prost_types::Any>, +} +/// 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 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Height { + /// the revision that the client is currently on + #[prost(uint64, tag = "1")] + pub revision_number: u64, + /// the height within the given revision + #[prost(uint64, tag = "2")] + pub revision_height: u64, +} +/// Params defines the set of IBC light client parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// allowed_clients defines the list of allowed client state types which can be created + /// and interacted with. If a client type is removed from the allowed clients list, usage + /// of this client will be disabled until it is added again to the list. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs new file mode 100644 index 00000000..f4150e15 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs @@ -0,0 +1,89 @@ +// @generated +/// Failure message contains information about ACK failures and can be used to +/// replay ACK in case of requirement. +/// Note that Failure means that sudo handler to cosmwasm contract failed for some reason +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Failure { + /// Address of the failed contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Id of the failure under specific address + #[prost(uint64, tag = "2")] + pub id: u64, + /// Serialized MessageSudoCallback with Packet and Ack(if exists) + #[prost(bytes = "vec", tag = "3")] + pub sudo_payload: ::prost::alloc::vec::Vec, + /// Redacted error response of the sudo call. Full error is emitted as an event + #[prost(string, tag = "4")] + pub error: ::prost::alloc::string::String, +} +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + #[prost(uint64, tag = "1")] + pub sudo_call_gas_limit: u64, +} +/// GenesisState defines the contractmanager module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// List of the contract failures + /// + /// this line is used by starport scaffolding # genesis/proto/state + #[prost(message, repeated, tag = "2")] + pub failures_list: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryFailuresRequest is request type for the Query/Failures RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryFailuresRequest { + /// address of the contract which Sudo call failed. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// ID of the failure for the given contract. + #[prost(uint64, tag = "2")] + pub failure_id: u64, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +/// QueryFailuresResponse is response type for the Query/Failures RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryFailuresResponse { + #[prost(message, repeated, tag = "1")] + pub failures: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/contractmanager parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("neutron.contractmanager.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs new file mode 100644 index 00000000..65d38314 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs @@ -0,0 +1,277 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.contractmanager.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.contractmanager.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn address_failure( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.contractmanager.Query/AddressFailure", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.contractmanager.Query", + "AddressFailure", + )); + self.inner.unary(req, path, codec).await + } + pub async fn address_failures( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.contractmanager.Query/AddressFailures", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.contractmanager.Query", + "AddressFailures", + )); + self.inner.unary(req, path, codec).await + } + pub async fn failures( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.contractmanager.Query/Failures"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.contractmanager.Query", "Failures")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.contractmanager.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.contractmanager.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs new file mode 100644 index 00000000..8c8d460a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs @@ -0,0 +1,21 @@ +// @generated +/// Deprecated. Used only for migration purposes. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Failure { + /// ChannelId + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// Address of the failed contract + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, + /// id of the failure under specific address + #[prost(uint64, tag = "3")] + pub id: u64, + /// ACK id to restore + #[prost(uint64, tag = "4")] + pub ack_id: u64, + /// Acknowledgement type + #[prost(string, tag = "5")] + pub ack_type: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs new file mode 100644 index 00000000..9361bb03 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs @@ -0,0 +1,105 @@ +// @generated +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Security address that can remove schedules + #[prost(string, tag = "1")] + pub security_address: ::prost::alloc::string::String, + /// Limit of schedules executed in one block + #[prost(uint64, tag = "2")] + pub limit: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Schedule { + /// Name of schedule + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Period in blocks + #[prost(uint64, tag = "2")] + pub period: u64, + /// Msgs that will be executed every period amount of time + #[prost(message, repeated, tag = "3")] + pub msgs: ::prost::alloc::vec::Vec, + /// Last execution's block height + #[prost(uint64, tag = "4")] + pub last_execute_height: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgExecuteContract { + /// Contract is the address of the smart contract + #[prost(string, tag = "1")] + pub contract: ::prost::alloc::string::String, + /// Msg is json encoded message to be passed to the contract + #[prost(string, tag = "2")] + pub msg: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScheduleCount { + /// Count is the number of current schedules + #[prost(int32, tag = "1")] + pub count: i32, +} +/// GenesisState defines the cron module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, repeated, tag = "2")] + pub schedule_list: ::prost::alloc::vec::Vec, + /// this line is used by starport scaffolding # genesis/proto/state + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetScheduleRequest { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetScheduleResponse { + #[prost(message, optional, tag = "1")] + pub schedule: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySchedulesRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySchedulesResponse { + #[prost(message, repeated, tag = "1")] + pub schedules: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +// this line is used by starport scaffolding # proto/tx/message + +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/cron parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("neutron.cron.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs new file mode 100644 index 00000000..a2195d03 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs @@ -0,0 +1,246 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.cron.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn schedule( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Schedule"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.cron.Query", "Schedule")); + self.inner.unary(req, path, codec).await + } + pub async fn schedules( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Schedules"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.cron.Query", "Schedules")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.cron.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.cron.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs new file mode 100644 index 00000000..708ec656 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs @@ -0,0 +1,619 @@ +// @generated +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PairId { + #[prost(string, tag = "1")] + pub token0: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token1: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DepositRecord { + #[prost(message, optional, tag = "1")] + pub pair_id: ::core::option::Option, + #[prost(string, tag = "2")] + pub shares_owned: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub center_tick_index: i64, + #[prost(int64, tag = "4")] + pub lower_tick_index: i64, + #[prost(int64, tag = "5")] + pub upper_tick_index: i64, + #[prost(uint64, tag = "6")] + pub fee: u64, +} +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + #[prost(uint64, repeated, tag = "1")] + pub fee_tiers: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TradePairId { + #[prost(string, tag = "2")] + pub maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub taker_denom: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DepositOptions { + #[prost(bool, tag = "1")] + pub disable_autoswap: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeposit { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub token_a: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub token_b: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "5")] + pub amounts_a: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "6")] + pub amounts_b: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(int64, repeated, tag = "7")] + pub tick_indexes_a_to_b: ::prost::alloc::vec::Vec, + #[prost(uint64, repeated, tag = "8")] + pub fees: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "9")] + pub options: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDepositResponse { + #[prost(string, repeated, tag = "1")] + pub reserve0_deposited: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "2")] + pub reserve1_deposited: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawal { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub token_a: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub token_b: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "5")] + pub shares_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(int64, repeated, tag = "6")] + pub tick_indexes_a_to_b: ::prost::alloc::vec::Vec, + #[prost(uint64, repeated, tag = "7")] + pub fees: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawalResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPlaceLimitOrder { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub token_in: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub token_out: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + pub tick_index_in_to_out: i64, + #[prost(string, tag = "7")] + pub amount_in: ::prost::alloc::string::String, + #[prost(enumeration = "LimitOrderType", tag = "8")] + pub order_type: i32, + /// expirationTime is only valid iff orderType == GOOD_TIL_TIME. + #[prost(message, optional, tag = "9")] + pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "10")] + pub max_amount_out: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPlaceLimitOrderResponse { + #[prost(string, tag = "1")] + pub tranche_key: ::prost::alloc::string::String, + /// Total amount of coin used for the limit order + #[prost(message, optional, tag = "2")] + pub coin_in: ::core::option::Option, + /// Total amount of coin received from the taker portion of the limit order + /// This is the amount of coin immediately available in the users account after executing the + /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + #[prost(message, optional, tag = "3")] + pub taker_coin_out: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawFilledLimitOrder { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawFilledLimitOrderResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelLimitOrder { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelLimitOrderResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MultiHopRoute { + #[prost(string, repeated, tag = "1")] + pub hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiHopSwap { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub routes: ::prost::alloc::vec::Vec, + #[prost(string, tag = "4")] + pub amount_in: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub exit_limit_price: ::prost::alloc::string::String, + /// If pickBestRoute == true then all routes are run and the route with the best price is chosen + /// otherwise, the first successful route is used. + #[prost(bool, tag = "6")] + pub pick_best_route: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiHopSwapResponse { + #[prost(message, optional, tag = "1")] + pub coin_out: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum LimitOrderType { + GoodTilCancelled = 0, + FillOrKill = 1, + ImmediateOrCancel = 2, + JustInTime = 3, + GoodTilTime = 4, +} +impl LimitOrderType { + /// 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 { + LimitOrderType::GoodTilCancelled => "GOOD_TIL_CANCELLED", + LimitOrderType::FillOrKill => "FILL_OR_KILL", + LimitOrderType::ImmediateOrCancel => "IMMEDIATE_OR_CANCEL", + LimitOrderType::JustInTime => "JUST_IN_TIME", + LimitOrderType::GoodTilTime => "GOOD_TIL_TIME", + } + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderTrancheUser { + #[prost(message, optional, tag = "1")] + pub trade_pair_id: ::core::option::Option, + #[prost(int64, tag = "2")] + pub tick_index_taker_to_maker: i64, + #[prost(string, tag = "3")] + pub tranche_key: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub shares_owned: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub shares_withdrawn: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub shares_cancelled: ::prost::alloc::string::String, + #[prost(enumeration = "LimitOrderType", tag = "8")] + pub order_type: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderTrancheKey { + #[prost(message, optional, tag = "1")] + pub trade_pair_id: ::core::option::Option, + #[prost(int64, tag = "2")] + pub tick_index_taker_to_maker: i64, + #[prost(string, tag = "3")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderTranche { + #[prost(message, optional, tag = "1")] + pub key: ::core::option::Option, + #[prost(string, tag = "2")] + pub reserves_maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub reserves_taker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub total_maker_denom: ::prost::alloc::string::String, + /// GoodTilDate is represented as seconds since January 1, year 1, 00:00:00.00 UTC + /// LimitOrders with goodTilDate set are valid as long as blockTime <= goodTilDate + #[prost(string, tag = "5")] + pub total_taker_denom: ::prost::alloc::string::String, + /// JIT orders also use goodTilDate to handle deletion but represent a special case + /// All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live + /// Order deletion still functions the same and the orders will be deleted at the end of the block + #[prost(message, optional, tag = "6")] + pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "7")] + pub price_taker_to_maker: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PoolReservesKey { + #[prost(message, optional, tag = "1")] + pub trade_pair_id: ::core::option::Option, + #[prost(int64, tag = "2")] + pub tick_index_taker_to_maker: i64, + #[prost(uint64, tag = "3")] + pub fee: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PoolReserves { + #[prost(message, optional, tag = "1")] + pub key: ::core::option::Option, + #[prost(string, tag = "2")] + pub reserves_maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub price_taker_to_maker: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub price_opposite_taker_to_maker: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TickLiquidity { + #[prost(oneof = "tick_liquidity::Liquidity", tags = "1, 2")] + pub liquidity: ::core::option::Option, +} +/// Nested message and enum types in `TickLiquidity`. +pub mod tick_liquidity { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Liquidity { + #[prost(message, tag = "1")] + PoolReserves(super::PoolReserves), + #[prost(message, tag = "2")] + LimitOrderTranche(super::LimitOrderTranche), + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PoolMetadata { + #[prost(uint64, tag = "1")] + pub id: u64, + #[prost(int64, tag = "2")] + pub tick: i64, + #[prost(uint64, tag = "3")] + pub fee: u64, + #[prost(message, optional, tag = "4")] + pub pair_id: ::core::option::Option, +} +/// GenesisState defines the dex module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub tick_liquidity_list: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub inactive_limit_order_tranche_list: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub limit_order_tranche_user_list: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub pool_metadata_list: ::prost::alloc::vec::Vec, + /// this line is used by starport scaffolding # genesis/proto/state + #[prost(uint64, tag = "6")] + pub pool_count: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderExpiration { + /// see limitOrderTranche.proto for details on goodTilDate + #[prost(message, optional, tag = "1")] + pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(bytes = "vec", tag = "2")] + pub tranche_ref: ::prost::alloc::vec::Vec, +} +// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool. + +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Pool { + #[prost(uint64, tag = "1")] + pub id: u64, + #[prost(message, optional, tag = "2")] + pub lower_tick0: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub upper_tick1: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetLimitOrderTrancheUserRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetLimitOrderTrancheUserResponse { + #[prost(message, optional, tag = "1")] + pub limit_order_tranche_user: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllLimitOrderTrancheUserRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllLimitOrderTrancheUserResponse { + #[prost(message, repeated, tag = "1")] + pub limit_order_tranche_user: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetLimitOrderTrancheRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub tick_index: i64, + #[prost(string, tag = "3")] + pub token_in: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetLimitOrderTrancheResponse { + #[prost(message, optional, tag = "1")] + pub limit_order_tranche: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllLimitOrderTrancheRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_in: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllLimitOrderTrancheResponse { + #[prost(message, repeated, tag = "1")] + pub limit_order_tranche: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllUserDepositsRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllUserDepositsResponse { + #[prost(message, repeated, tag = "1")] + pub deposits: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllUserLimitOrdersRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllUserLimitOrdersResponse { + #[prost(message, repeated, tag = "1")] + pub limit_orders: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllTickLiquidityRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_in: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllTickLiquidityResponse { + #[prost(message, repeated, tag = "1")] + pub tick_liquidity: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetInactiveLimitOrderTrancheRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_in: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub tick_index: i64, + #[prost(string, tag = "4")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetInactiveLimitOrderTrancheResponse { + #[prost(message, optional, tag = "1")] + pub inactive_limit_order_tranche: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllInactiveLimitOrderTrancheRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllInactiveLimitOrderTrancheResponse { + #[prost(message, repeated, tag = "1")] + pub inactive_limit_order_tranche: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllPoolReservesRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_in: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllPoolReservesResponse { + #[prost(message, repeated, tag = "1")] + pub pool_reserves: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetPoolReservesRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_in: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub tick_index: i64, + #[prost(uint64, tag = "4")] + pub fee: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetPoolReservesResponse { + #[prost(message, optional, tag = "1")] + pub pool_reserves: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEstimateMultiHopSwapRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub routes: ::prost::alloc::vec::Vec, + #[prost(string, tag = "4")] + pub amount_in: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub exit_limit_price: ::prost::alloc::string::String, + /// If pickBestRoute == true then all routes are run and the route with the best price is chosen + /// otherwise, the first successful route is used. + #[prost(bool, tag = "6")] + pub pick_best_route: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEstimateMultiHopSwapResponse { + #[prost(message, optional, tag = "1")] + pub coin_out: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEstimatePlaceLimitOrderRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub receiver: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub token_in: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub token_out: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + pub tick_index_in_to_out: i64, + #[prost(string, tag = "6")] + pub amount_in: ::prost::alloc::string::String, + #[prost(enumeration = "LimitOrderType", tag = "7")] + pub order_type: i32, + /// expirationTime is only valid iff orderType == GOOD_TIL_TIME. + #[prost(message, optional, tag = "8")] + pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "9")] + pub max_amount_out: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEstimatePlaceLimitOrderResponse { + /// Total amount of coin used for the limit order + /// You can derive makerLimitInCoin using the equation: totalInCoin = swapInCoin + makerLimitInCoin + #[prost(message, optional, tag = "1")] + pub total_in_coin: ::core::option::Option, + /// Total amount of the token in that was immediately swapped for swapOutCoin + #[prost(message, optional, tag = "2")] + pub swap_in_coin: ::core::option::Option, + /// Total amount of coin received from the taker portion of the limit order + /// This is the amount of coin immediately available in the users account after executing the + /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + #[prost(message, optional, tag = "3")] + pub swap_out_coin: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPoolRequest { + #[prost(string, tag = "1")] + pub pair_id: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub tick_index: i64, + #[prost(uint64, tag = "3")] + pub fee: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPoolByIdRequest { + #[prost(uint64, tag = "1")] + pub pool_id: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPoolResponse { + #[prost(message, optional, tag = "1")] + pub pool: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetPoolMetadataRequest { + #[prost(uint64, tag = "1")] + pub id: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetPoolMetadataResponse { + #[prost(message, optional, tag = "1")] + pub pool_metadata: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllPoolMetadataRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllPoolMetadataResponse { + #[prost(message, repeated, tag = "1")] + pub pool_metadata: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +include!("neutron.dex.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs new file mode 100644 index 00000000..e68c625f --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs @@ -0,0 +1,668 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn deposit( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/Deposit"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "Deposit")); + self.inner.unary(req, path, codec).await + } + pub async fn withdrawal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/Withdrawal"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "Withdrawal")); + self.inner.unary(req, path, codec).await + } + pub async fn place_limit_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/PlaceLimitOrder"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "PlaceLimitOrder")); + self.inner.unary(req, path, codec).await + } + pub async fn withdraw_filled_limit_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Msg/WithdrawFilledLimitOrder"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Msg", + "WithdrawFilledLimitOrder", + )); + self.inner.unary(req, path, codec).await + } + pub async fn cancel_limit_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/CancelLimitOrder"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "CancelLimitOrder")); + self.inner.unary(req, path, codec).await + } + pub async fn multi_hop_swap( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/MultiHopSwap"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "MultiHopSwap")); + self.inner.unary(req, path, codec).await + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn limit_order_tranche_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheUser"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "LimitOrderTrancheUser", + )); + self.inner.unary(req, path, codec).await + } + pub async fn limit_order_tranche_user_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheUserAll"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "LimitOrderTrancheUserAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn limit_order_tranche_user_all_by_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "LimitOrderTrancheUserAllByAddress", + )); + self.inner.unary(req, path, codec).await + } + pub async fn limit_order_tranche( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTranche"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "LimitOrderTranche")); + self.inner.unary(req, path, codec).await + } + pub async fn limit_order_tranche_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "LimitOrderTrancheAll")); + self.inner.unary(req, path, codec).await + } + pub async fn user_deposits_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/UserDepositsAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "UserDepositsAll")); + self.inner.unary(req, path, codec).await + } + pub async fn tick_liquidity_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/TickLiquidityAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "TickLiquidityAll")); + self.inner.unary(req, path, codec).await + } + pub async fn inactive_limit_order_tranche( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.dex.Query/InactiveLimitOrderTranche", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "InactiveLimitOrderTranche", + )); + self.inner.unary(req, path, codec).await + } + pub async fn inactive_limit_order_tranche_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.dex.Query/InactiveLimitOrderTrancheAll", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "InactiveLimitOrderTrancheAll", + )); + self.inner.unary(req, path, codec).await + } + pub async fn pool_reserves_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolReservesAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "PoolReservesAll")); + self.inner.unary(req, path, codec).await + } + pub async fn pool_reserves( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolReserves"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "PoolReserves")); + self.inner.unary(req, path, codec).await + } + pub async fn estimate_multi_hop_swap( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Query/EstimateMultiHopSwap"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "EstimateMultiHopSwap")); + self.inner.unary(req, path, codec).await + } + pub async fn estimate_place_limit_order( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.dex.Query/EstimatePlaceLimitOrder"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.dex.Query", + "EstimatePlaceLimitOrder", + )); + self.inner.unary(req, path, codec).await + } + pub async fn pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/Pool"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "Pool")); + self.inner.unary(req, path, codec).await + } + pub async fn pool_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolByID"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "PoolByID")); + self.inner.unary(req, path, codec).await + } + pub async fn pool_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolMetadata"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "PoolMetadata")); + self.inner.unary(req, path, codec).await + } + pub async fn pool_metadata_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolMetadataAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.dex.Query", "PoolMetadataAll")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs new file mode 100644 index 00000000..312b962a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs @@ -0,0 +1,73 @@ +// @generated +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Defines Neutron denom, which will be burned during fee processing, any + /// other denom will be sent to Treasury + #[prost(string, tag = "1")] + pub neutron_denom: ::prost::alloc::string::String, + /// Deprecated in v0.4.4. Is not used anymore + #[prost(string, tag = "2")] + pub reserve_address: ::prost::alloc::string::String, + /// Defines treasury address + #[prost(string, tag = "3")] + pub treasury_address: ::prost::alloc::string::String, +} +/// TotalBurnedNeutronsAmount defines total amount of burned neutron fees +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TotalBurnedNeutronsAmount { + #[prost(message, optional, tag = "1")] + pub coin: ::core::option::Option, +} +/// GenesisState defines the feeburner module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// this line is used by starport scaffolding # genesis/proto/state + #[prost(message, optional, tag = "2")] + pub total_burned_neutrons_amount: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryTotalBurnedNeutronsAmountRequest is request type for the +/// Query/QueryTotalBurnedNeutronsAmount method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalBurnedNeutronsAmountRequest {} +/// QueryTotalBurnedNeutronsAmountResponse is response type for the +/// Query/QueryTotalBurnedNeutronsAmount method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalBurnedNeutronsAmountResponse { + #[prost(message, optional, tag = "1")] + pub total_burned_neutrons_amount: ::core::option::Option, +} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/feeburner parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("neutron.feeburner.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs new file mode 100644 index 00000000..7d4e2ac5 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs @@ -0,0 +1,238 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /** Parameters queries the parameters of the module. + */ + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.feeburner.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.feeburner.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /** TotalBurnedNeutronsAmount queries total amount of burned neutron fees. + */ + pub async fn total_burned_neutrons_amount( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.feeburner.Query/TotalBurnedNeutronsAmount", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.feeburner.Query", + "TotalBurnedNeutronsAmount", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.feeburner.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.feeburner.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs new file mode 100644 index 00000000..bced97e0 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs @@ -0,0 +1,93 @@ +// @generated +/// Fee defines the ICS29 receive, acknowledgement and timeout fees +#[derive(Clone, PartialEq, ::prost::Message)] +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, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketId { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub sequence: u64, +} +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + #[prost(message, optional, tag = "1")] + pub min_fee: ::core::option::Option, +} +/// GenesisState defines the fee module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// this line is used by starport scaffolding # genesis/proto/state + #[prost(message, repeated, tag = "2")] + pub fee_infos: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeeInfo { + #[prost(string, tag = "1")] + pub payer: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub packet_id: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub fee: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeeInfoRequest { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub sequence: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeeInfoResponse { + #[prost(message, optional, tag = "1")] + pub fee_info: ::core::option::Option, +} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/feerefunder parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("neutron.feerefunder.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs new file mode 100644 index 00000000..b5bf3b13 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs @@ -0,0 +1,228 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.feerefunder.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.feerefunder.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn fee_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.feerefunder.Query/FeeInfo"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.feerefunder.Query", "FeeInfo")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.feerefunder.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.feerefunder.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs new file mode 100644 index 00000000..b31c0830 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs @@ -0,0 +1,290 @@ +// @generated +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Defines amount of blocks required before query becomes available for + /// removal by anybody + #[prost(uint64, tag = "1")] + pub query_submit_timeout: u64, + /// Amount of coins deposited for the query. + #[prost(message, repeated, tag = "2")] + pub query_deposit: ::prost::alloc::vec::Vec, + /// Amount of tx hashes to be removed during a single EndBlock. Can vary to + /// balance between network cleaning speed and EndBlock duration. A zero value + /// means no limit. + #[prost(uint64, tag = "3")] + pub tx_query_removal_limit: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisteredQuery { + /// The unique id of the registered query. + #[prost(uint64, tag = "1")] + pub id: u64, + /// The address that registered the query. + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, + /// The query type identifier: `kv` or `tx` now + #[prost(string, tag = "3")] + pub query_type: ::prost::alloc::string::String, + /// The KV-storage keys for which we want to get values from remote chain + #[prost(message, repeated, tag = "4")] + pub keys: ::prost::alloc::vec::Vec, + /// The filter for transaction search ICQ + #[prost(string, tag = "5")] + pub transactions_filter: ::prost::alloc::string::String, + /// The IBC connection ID for getting ConsensusState to verify proofs + #[prost(string, tag = "6")] + pub connection_id: ::prost::alloc::string::String, + /// Parameter that defines how often the query must be updated. + #[prost(uint64, tag = "7")] + pub update_period: u64, + /// The local chain last block height when the query result was updated. + #[prost(uint64, tag = "8")] + pub last_submitted_result_local_height: u64, + /// The remote chain last block height when the query result was updated. + #[prost(message, optional, tag = "9")] + pub last_submitted_result_remote_height: + ::core::option::Option, + /// Amount of coins deposited for the query. + #[prost(message, repeated, tag = "10")] + pub deposit: ::prost::alloc::vec::Vec, + /// Timeout before query becomes available for everybody to remove. + #[prost(uint64, tag = "11")] + pub submit_timeout: u64, + /// The local chain height when the query was registered. + #[prost(uint64, tag = "12")] + pub registered_at_height: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct KvKey { + /// Path (storage prefix) to the storage where you want to read value by key + /// (usually name of cosmos-sdk module: 'staking', 'bank', etc.) + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// Key you want to read from the storage + #[prost(bytes = "vec", tag = "2")] + pub key: ::prost::alloc::vec::Vec, +} +/// GenesisState defines the interchainqueries module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub registered_queries: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainQuery { + /// defines a query type: `kv` or `tx` now + #[prost(string, tag = "1")] + pub query_type: ::prost::alloc::string::String, + /// is used to define KV-storage keys for which we want to get values from + /// remote chain + #[prost(message, repeated, tag = "2")] + pub keys: ::prost::alloc::vec::Vec, + /// is used to define a filter for transaction search ICQ + #[prost(string, tag = "3")] + pub transactions_filter: ::prost::alloc::string::String, + /// is IBC connection ID for getting ConsensusState to verify proofs + #[prost(string, tag = "4")] + pub connection_id: ::prost::alloc::string::String, + /// is used to specify how often (in neutron blocks) the query must be updated + #[prost(uint64, tag = "5")] + pub update_period: u64, + /// is the signer of the message + #[prost(string, tag = "6")] + pub sender: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainQueryResponse { + #[prost(uint64, tag = "1")] + pub id: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitQueryResult { + #[prost(uint64, tag = "1")] + pub query_id: u64, + #[prost(string, tag = "2")] + pub sender: ::prost::alloc::string::String, + /// is the IBC client ID for an IBC connection between Neutron chain and target + /// chain (where the result was obtained from) + #[prost(string, tag = "3")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub result: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryResult { + #[prost(message, repeated, tag = "1")] + pub kv_results: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option, + #[prost(uint64, tag = "3")] + pub height: u64, + #[prost(uint64, tag = "4")] + pub revision: u64, + #[prost(bool, tag = "5")] + pub allow_kv_callbacks: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StorageValue { + /// is the substore name (acc, staking, etc.) + #[prost(string, tag = "1")] + pub storage_prefix: ::prost::alloc::string::String, + /// is the key in IAVL store + #[prost(bytes = "vec", tag = "2")] + pub key: ::prost::alloc::vec::Vec, + /// is the value in IAVL store + #[prost(bytes = "vec", tag = "3")] + pub value: ::prost::alloc::vec::Vec, + /// is the Merkle Proof which proves existence of key-value pair in IAVL + /// storage + #[prost(message, optional, tag = "4")] + pub proof: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Block { + /// We need to know block X+1 to verify response of transaction for block X + /// since LastResultsHash is root hash of all results from the txs from the + /// previous block + #[prost(message, optional, tag = "1")] + pub next_block_header: ::core::option::Option<::prost_types::Any>, + /// We need to know block X to verify inclusion of transaction for block X + #[prost(message, optional, tag = "2")] + pub header: ::core::option::Option<::prost_types::Any>, + #[prost(message, optional, tag = "3")] + pub tx: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxValue { + #[prost(message, optional, tag = "1")] + pub response: ::core::option::Option, + /// is the Merkle Proof which proves existence of response in block with height + /// next_block_header.Height + #[prost(message, optional, tag = "2")] + pub delivery_proof: ::core::option::Option, + /// is the Merkle Proof which proves existence of data in block with height + /// header.Height + #[prost(message, optional, tag = "3")] + pub inclusion_proof: ::core::option::Option, + /// is body of the transaction + #[prost(bytes = "vec", tag = "4")] + pub data: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitQueryResultResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveInterchainQueryRequest { + #[prost(uint64, tag = "1")] + pub query_id: u64, + /// is the signer of the message + #[prost(string, tag = "2")] + pub sender: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveInterchainQueryResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateInterchainQueryRequest { + #[prost(uint64, tag = "1")] + pub query_id: u64, + #[prost(message, repeated, tag = "2")] + pub new_keys: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "3")] + pub new_update_period: u64, + #[prost(string, tag = "4")] + pub new_transactions_filter: ::prost::alloc::string::String, + /// is the signer of the message + #[prost(string, tag = "5")] + pub sender: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateInterchainQueryResponse {} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/interchainqueries parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueriesRequest { + #[prost(string, repeated, tag = "1")] + pub owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueriesResponse { + #[prost(message, repeated, tag = "1")] + pub registered_queries: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueryRequest { + #[prost(uint64, tag = "1")] + pub query_id: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueryResponse { + #[prost(message, optional, tag = "1")] + pub registered_query: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueryResultRequest { + #[prost(uint64, tag = "1")] + pub query_id: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRegisteredQueryResultResponse { + #[prost(message, optional, tag = "1")] + pub result: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Transaction { + #[prost(uint64, tag = "1")] + pub id: u64, + #[prost(uint64, tag = "2")] + pub height: u64, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryLastRemoteHeight { + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryLastRemoteHeightResponse { + #[prost(uint64, tag = "1")] + pub height: u64, +} +include!("neutron.interchainqueries.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs new file mode 100644 index 00000000..40591789 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs @@ -0,0 +1,400 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn register_interchain_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Msg/RegisterInterchainQuery", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Msg", + "RegisterInterchainQuery", + )); + self.inner.unary(req, path, codec).await + } + pub async fn submit_query_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Msg/SubmitQueryResult", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Msg", + "SubmitQueryResult", + )); + self.inner.unary(req, path, codec).await + } + pub async fn remove_interchain_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Msg/RemoveInterchainQuery", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Msg", + "RemoveInterchainQuery", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_interchain_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Msg/UpdateInterchainQuery", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Msg", + "UpdateInterchainQuery", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.interchainqueries.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.interchainqueries.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.interchainqueries.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn registered_queries( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Query/RegisteredQueries", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Query", + "RegisteredQueries", + )); + self.inner.unary(req, path, codec).await + } + pub async fn registered_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Query/RegisteredQuery", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Query", + "RegisteredQuery", + )); + self.inner.unary(req, path, codec).await + } + pub async fn query_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Query/QueryResult", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Query", + "QueryResult", + )); + self.inner.unary(req, path, codec).await + } + pub async fn last_remote_height( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchainqueries.Query/LastRemoteHeight", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchainqueries.Query", + "LastRemoteHeight", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs new file mode 100644 index 00000000..5af47567 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs @@ -0,0 +1,51 @@ +// @generated +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Defines maximum amount of messages to be passed in MsgSubmitTx + #[prost(uint64, tag = "1")] + pub msg_submit_tx_max_messages: u64, + /// Defines a minimum fee required to register interchain account + #[prost(message, repeated, tag = "2")] + pub register_fee: ::prost::alloc::vec::Vec, +} +/// GenesisState defines the interchaintxs module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInterchainAccountAddressRequest { + /// owner_address is the owner of the interchain account on the controller + /// chain + #[prost(string, tag = "1")] + pub owner_address: ::prost::alloc::string::String, + /// interchain_account_id is an identifier of your interchain account from + /// which you want to execute msgs + #[prost(string, tag = "2")] + pub interchain_account_id: ::prost::alloc::string::String, + /// connection_id is an IBC connection identifier between Neutron and remote + /// chain + #[prost(string, tag = "3")] + pub connection_id: ::prost::alloc::string::String, +} +/// Query response for an interchain account address +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInterchainAccountAddressResponse { + /// The corresponding interchain account address on the host chain + #[prost(string, tag = "1")] + pub interchain_account_address: ::prost::alloc::string::String, +} +include!("neutron.interchaintxs.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs new file mode 100644 index 00000000..58f62857 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs @@ -0,0 +1,131 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.interchaintxs.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.interchaintxs.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn interchain_account_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchaintxs.Query/InterchainAccountAddress", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchaintxs.Query", + "InterchainAccountAddress", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs new file mode 100644 index 00000000..005c33aa --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs @@ -0,0 +1,72 @@ +// @generated +/// MsgRegisterInterchainAccount is used to register an account on a remote zone. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainAccount { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub interchain_account_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "4")] + pub register_fee: ::prost::alloc::vec::Vec, +} +/// MsgRegisterInterchainAccountResponse is the response type for +/// MsgRegisterInterchainAccount. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainAccountResponse {} +/// MsgSubmitTx defines the payload for Msg/SubmitTx +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitTx { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + /// interchain_account_id is supposed to be the unique identifier, e.g., + /// lido/kava. This allows contracts to have more than one interchain accounts + /// on remote zone This identifier will be a part of the portID that we'll + /// claim our capability for. + #[prost(string, tag = "2")] + pub interchain_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub connection_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "4")] + pub msgs: ::prost::alloc::vec::Vec<::prost_types::Any>, + #[prost(string, tag = "5")] + pub memo: ::prost::alloc::string::String, + /// timeout in seconds after which the packet times out + #[prost(uint64, tag = "6")] + pub timeout: u64, + #[prost(message, optional, tag = "7")] + pub fee: ::core::option::Option, +} +/// MsgSubmitTxResponse defines the response for Msg/SubmitTx +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitTxResponse { + /// channel's sequence_id for outgoing ibc packet. Unique per a channel. + #[prost(uint64, tag = "1")] + pub sequence_id: u64, + /// channel src channel on neutron side transaction was submitted from + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, +} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/interchaintxs parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("neutron.interchaintxs.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs new file mode 100644 index 00000000..1ee1b6f7 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs @@ -0,0 +1,150 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn register_interchain_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/neutron.interchaintxs.v1.Msg/RegisterInterchainAccount", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchaintxs.v1.Msg", + "RegisterInterchainAccount", + )); + self.inner.unary(req, path, codec).await + } + pub async fn submit_tx( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.interchaintxs.v1.Msg/SubmitTx"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.interchaintxs.v1.Msg", "SubmitTx")); + self.inner.unary(req, path, codec).await + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/neutron.interchaintxs.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "neutron.interchaintxs.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs new file mode 100644 index 00000000..c1c70ef4 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs @@ -0,0 +1,44 @@ +// @generated +#[derive(Clone, PartialEq, ::prost::Message)] +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")] + pub timeout_timestamp: u64, + #[prost(string, tag = "8")] + pub memo: ::prost::alloc::string::String, + #[prost(message, optional, tag = "9")] + pub fee: ::core::option::Option, +} +/// MsgTransferResponse is the modified response type for +/// ibc-go MsgTransfer. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransferResponse { + /// channel's sequence_id for outgoing ibc packet. Unique per a channel. + #[prost(uint64, tag = "1")] + pub sequence_id: u64, + /// channel src channel on neutron side trasaction was submitted from + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, +} +include!("neutron.transfer.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs new file mode 100644 index 00000000..3216be2c --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs @@ -0,0 +1,296 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /** DenomTrace queries a denomination trace information. + */ + pub async fn denom_trace( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::ibc::applications::transfer::v1::QueryDenomTraceRequest, + >, + ) -> std::result::Result< + tonic::Response< + super::super::super::ibc::applications::transfer::v1::QueryDenomTraceResponse, + >, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomTrace"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.transfer.Query", "DenomTrace")); + self.inner.unary(req, path, codec).await + } + /** DenomTraces queries all denomination traces. + */ + pub async fn denom_traces( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::ibc::applications::transfer::v1::QueryDenomTracesRequest, + >, + ) -> std::result::Result< + tonic::Response< + super::super::super::ibc::applications::transfer::v1::QueryDenomTracesResponse, + >, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomTraces"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.transfer.Query", "DenomTraces")); + self.inner.unary(req, path, codec).await + } + /** Params queries all parameters of the ibc-transfer module. + */ + pub async fn params( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::ibc::applications::transfer::v1::QueryParamsRequest, + >, + ) -> std::result::Result< + tonic::Response< + super::super::super::ibc::applications::transfer::v1::QueryParamsResponse, + >, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.transfer.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /** DenomHash queries a denomination hash information. + */ + pub async fn denom_hash( + &mut self, + request: impl tonic::IntoRequest< + super::super::super::ibc::applications::transfer::v1::QueryDenomHashRequest, + >, + ) -> std::result::Result< + tonic::Response< + super::super::super::ibc::applications::transfer::v1::QueryDenomHashResponse, + >, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomHash"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.transfer.Query", "DenomHash")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Msg/Transfer"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("neutron.transfer.Msg", "Transfer")); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs new file mode 100644 index 00000000..680b1efa --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs @@ -0,0 +1,230 @@ +// @generated +/// DenomAuthorityMetadata specifies metadata for addresses that have specific +/// capabilities over a token factory denom. Right now there is only one Admin +/// permission, but is planned to be extended to the future. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenomAuthorityMetadata { + /// Can be empty for no admin, or a valid osmosis address + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, +} +/// Params defines the parameters for the tokenfactory module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// DenomCreationFee defines the fee to be charged on the creation of a new + /// denom. The fee is drawn from the MsgCreateDenom's sender account, and + /// transferred to the community pool. + #[prost(message, repeated, tag = "1")] + pub denom_creation_fee: + ::prost::alloc::vec::Vec, + /// DenomCreationGasConsume defines the gas cost for creating a new denom. + /// This is intended as a spam deterrence mechanism. + /// + /// See: + #[prost(uint64, tag = "2")] + pub denom_creation_gas_consume: u64, + /// FeeCollectorAddress is the address where fees collected from denom creation are sent to + #[prost(string, tag = "3")] + pub fee_collector_address: ::prost::alloc::string::String, +} +/// GenesisState defines the tokenfactory module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// params defines the paramaters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub factory_denoms: ::prost::alloc::vec::Vec, +} +/// GenesisDenom defines a tokenfactory denom that is defined within genesis +/// state. The structure contains DenomAuthorityMetadata which defines the +/// denom's admin. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisDenom { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub authority_metadata: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryDenomAuthorityMetadataRequest defines the request structure for the +/// DenomAuthorityMetadata gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomAuthorityMetadataRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub subdenom: ::prost::alloc::string::String, +} +/// QueryDenomAuthorityMetadataResponse defines the response structure for the +/// DenomAuthorityMetadata gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomAuthorityMetadataResponse { + #[prost(message, optional, tag = "1")] + pub authority_metadata: ::core::option::Option, +} +/// QueryDenomsFromCreatorRequest defines the request structure for the +/// DenomsFromCreator gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsFromCreatorRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, +} +/// QueryDenomsFromCreatorRequest defines the response structure for the +/// DenomsFromCreator gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsFromCreatorResponse { + #[prost(string, repeated, tag = "1")] + pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBeforeSendHookAddressRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub subdenom: ::prost::alloc::string::String, +} +/// QueryBeforeSendHookAddressResponse defines the response structure for the +/// DenomBeforeSendHook gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBeforeSendHookAddressResponse { + #[prost(string, tag = "1")] + pub contract_addr: ::prost::alloc::string::String, +} +/// MsgCreateDenom defines the message structure for the CreateDenom gRPC service +/// method. It allows an account to create a new denom. It requires a sender +/// address and a sub denomination. The (sender_address, sub_denomination) tuple +/// must be unique and cannot be re-used. +/// +/// The resulting denom created is defined as +/// . The resulting denom's admin is +/// originally set to be the creator, but this can be changed later. The token +/// denom does not indicate the current admin. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateDenom { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// subdenom can be up to 44 "alphanumeric" characters long. + #[prost(string, tag = "2")] + pub subdenom: ::prost::alloc::string::String, +} +/// MsgCreateDenomResponse is the return value of MsgCreateDenom +/// It returns the full string of the newly created denom +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateDenomResponse { + #[prost(string, tag = "1")] + pub new_token_denom: ::prost::alloc::string::String, +} +/// MsgMint is the sdk.Msg type for allowing an admin account to mint +/// more of a token. For now, we only support minting to the sender account +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMint { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub mint_to_address: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMintResponse {} +/// MsgBurn is the sdk.Msg type for allowing an admin account to burn +/// a token. For now, we only support burning from the sender account. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBurn { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub burn_from_address: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBurnResponse {} +/// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +/// adminship of a denom to a new account +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChangeAdmin { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgChangeAdminResponse defines the response structure for an executed +/// MsgChangeAdmin message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChangeAdminResponse {} +/// MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to +/// assign a CosmWasm contract to call with a BeforeSend hook +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetBeforeSendHook { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub contract_addr: ::prost::alloc::string::String, +} +/// MsgSetBeforeSendHookResponse defines the response structure for an executed +/// MsgSetBeforeSendHook message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetBeforeSendHookResponse {} +/// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set +/// the denom's bank metadata +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadata { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub metadata: ::core::option::Option, +} +/// MsgSetDenomMetadataResponse defines the response structure for an executed +/// MsgSetDenomMetadata message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadataResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgForceTransfer { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub transfer_from_address: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub transfer_to_address: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgForceTransferResponse {} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/tokenfactory parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("osmosis.tokenfactory.v1beta1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs b/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs new file mode 100644 index 00000000..6f325f2a --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs @@ -0,0 +1,435 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "Params", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denom_authority_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "DenomAuthorityMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denoms_from_creator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "DenomsFromCreator", + )); + self.inner.unary(req, path, codec).await + } + pub async fn before_send_hook_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Query/BeforeSendHookAddress", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "BeforeSendHookAddress", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn create_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "CreateDenom", + )); + self.inner.unary(req, path, codec).await + } + pub async fn mint( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Mint"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Mint")); + self.inner.unary(req, path, codec).await + } + pub async fn burn( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Burn"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Burn")); + self.inner.unary(req, path, codec).await + } + pub async fn change_admin( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "ChangeAdmin", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_denom_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "SetDenomMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_before_send_hook( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/SetBeforeSendHook", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "SetBeforeSendHook", + )); + self.inner.unary(req, path, codec).await + } + pub async fn force_transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "ForceTransfer", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/gogo.rs b/packages/neutron-sdk/src/proto_types/gogo.rs deleted file mode 100644 index 72d8ba4a..00000000 --- a/packages/neutron-sdk/src/proto_types/gogo.rs +++ /dev/null @@ -1,600 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `gogoproto/gogo.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -/// Extension fields -pub mod exts { - - pub const goproto_enum_prefix: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_enum_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const enum_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const enum_customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(62023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const enumdecl: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(62024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const enumvalue_customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::EnumValueOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(66001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const goproto_getters_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_enum_prefix_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const verbose_equal_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const face_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const gostring_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const populate_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const onlyone_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const equal_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const description_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63014, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const testgen_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63015, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const benchgen_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63016, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63017, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unmarshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63018, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const stable_marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63019, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const sizer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63020, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_enum_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63021, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const enum_stringer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63022, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unsafe_marshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unsafe_unmarshaler_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_extensions_map_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63025, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_unrecognized_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63026, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const gogoproto_import: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63027, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const protosizer_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63028, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const compare_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63029, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const typedecl_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63030, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const enumdecl_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63031, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_registration: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63032, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const messagename_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63033, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_sizecache_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63034, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_unkeyed_all: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FileOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(63035, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_getters: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const verbose_equal: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const face: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const gostring: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const populate: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const stringer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(67008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const onlyone: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const equal: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const description: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64014, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const testgen: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64015, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const benchgen: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64016, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64017, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unmarshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64018, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const stable_marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64019, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const sizer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64020, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unsafe_marshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64023, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const unsafe_unmarshaler: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64024, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_extensions_map: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64025, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_unrecognized: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64026, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const protosizer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64028, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const compare: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64029, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const typedecl: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64030, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const messagename: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64033, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_sizecache: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64034, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const goproto_unkeyed: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::MessageOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(64035, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const nullable: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65001, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const embed: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65002, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const customtype: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65003, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const customname: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65004, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const jsontag: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65005, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const moretags: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65006, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const casttype: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65007, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const castkey: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65008, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const castvalue: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65009, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); - - pub const stdtime: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65010, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const stdduration: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65011, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const wktpointer: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, bool> = ::protobuf::ext::ExtFieldOptional::new(65012, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_BOOL); - - pub const castrepeated: ::protobuf::ext::ExtFieldOptional<::protobuf::descriptor::FieldOptions, ::std::string::String> = ::protobuf::ext::ExtFieldOptional::new(65013, ::protobuf::descriptor::field_descriptor_proto::Type::TYPE_STRING); -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x14gogoproto/gogo.proto\x12\tgogoproto\x1a\x20google/protobuf/descrip\ - tor.proto:N\n\x13goproto_enum_prefix\x18\xb1\xe4\x03\x20\x01(\x08\x12\ - \x1c.google.protobuf.EnumOptionsR\x11goprotoEnumPrefix:R\n\x15goproto_en\ - um_stringer\x18\xc5\xe4\x03\x20\x01(\x08\x12\x1c.google.protobuf.EnumOpt\ - ionsR\x13goprotoEnumStringer:C\n\renum_stringer\x18\xc6\xe4\x03\x20\x01(\ - \x08\x12\x1c.google.protobuf.EnumOptionsR\x0cenumStringer:G\n\x0fenum_cu\ - stomname\x18\xc7\xe4\x03\x20\x01(\t\x12\x1c.google.protobuf.EnumOptionsR\ - \x0eenumCustomname::\n\x08enumdecl\x18\xc8\xe4\x03\x20\x01(\x08\x12\x1c.\ - google.protobuf.EnumOptionsR\x08enumdecl:V\n\x14enumvalue_customname\x18\ - \xd1\x83\x04\x20\x01(\t\x12!.google.protobuf.EnumValueOptionsR\x13enumva\ - lueCustomname:N\n\x13goproto_getters_all\x18\x99\xec\x03\x20\x01(\x08\ - \x12\x1c.google.protobuf.FileOptionsR\x11goprotoGettersAll:U\n\x17goprot\ - o_enum_prefix_all\x18\x9a\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.F\ - ileOptionsR\x14goprotoEnumPrefixAll:P\n\x14goproto_stringer_all\x18\x9b\ - \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x12goprotoStr\ - ingerAll:J\n\x11verbose_equal_all\x18\x9c\xec\x03\x20\x01(\x08\x12\x1c.g\ - oogle.protobuf.FileOptionsR\x0fverboseEqualAll:9\n\x08face_all\x18\x9d\ - \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x07faceAll:A\ - \n\x0cgostring_all\x18\x9e\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.\ - FileOptionsR\x0bgostringAll:A\n\x0cpopulate_all\x18\x9f\xec\x03\x20\x01(\ - \x08\x12\x1c.google.protobuf.FileOptionsR\x0bpopulateAll:A\n\x0cstringer\ - _all\x18\xa0\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ - \x0bstringerAll:?\n\x0bonlyone_all\x18\xa1\xec\x03\x20\x01(\x08\x12\x1c.\ - google.protobuf.FileOptionsR\nonlyoneAll:;\n\tequal_all\x18\xa5\xec\x03\ - \x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x08equalAll:G\n\x0fde\ - scription_all\x18\xa6\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileO\ - ptionsR\x0edescriptionAll:?\n\x0btestgen_all\x18\xa7\xec\x03\x20\x01(\ - \x08\x12\x1c.google.protobuf.FileOptionsR\ntestgenAll:A\n\x0cbenchgen_al\ - l\x18\xa8\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x0bb\ - enchgenAll:C\n\rmarshaler_all\x18\xa9\xec\x03\x20\x01(\x08\x12\x1c.googl\ - e.protobuf.FileOptionsR\x0cmarshalerAll:G\n\x0funmarshaler_all\x18\xaa\ - \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x0eunmarshale\ - rAll:P\n\x14stable_marshaler_all\x18\xab\xec\x03\x20\x01(\x08\x12\x1c.go\ - ogle.protobuf.FileOptionsR\x12stableMarshalerAll:;\n\tsizer_all\x18\xac\ - \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x08sizerAll:Y\ - \n\x19goproto_enum_stringer_all\x18\xad\xec\x03\x20\x01(\x08\x12\x1c.goo\ - gle.protobuf.FileOptionsR\x16goprotoEnumStringerAll:J\n\x11enum_stringer\ - _all\x18\xae\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ - \x0fenumStringerAll:P\n\x14unsafe_marshaler_all\x18\xaf\xec\x03\x20\x01(\ - \x08\x12\x1c.google.protobuf.FileOptionsR\x12unsafeMarshalerAll:T\n\x16u\ - nsafe_unmarshaler_all\x18\xb0\xec\x03\x20\x01(\x08\x12\x1c.google.protob\ - uf.FileOptionsR\x14unsafeUnmarshalerAll:[\n\x1agoproto_extensions_map_al\ - l\x18\xb1\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x17g\ - oprotoExtensionsMapAll:X\n\x18goproto_unrecognized_all\x18\xb2\xec\x03\ - \x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x16goprotoUnrecognize\ - dAll:I\n\x10gogoproto_import\x18\xb3\xec\x03\x20\x01(\x08\x12\x1c.google\ - .protobuf.FileOptionsR\x0fgogoprotoImport:E\n\x0eprotosizer_all\x18\xb4\ - \xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\rprotosizerAl\ - l:?\n\x0bcompare_all\x18\xb5\xec\x03\x20\x01(\x08\x12\x1c.google.protobu\ - f.FileOptionsR\ncompareAll:A\n\x0ctypedecl_all\x18\xb6\xec\x03\x20\x01(\ - \x08\x12\x1c.google.protobuf.FileOptionsR\x0btypedeclAll:A\n\x0cenumdecl\ - _all\x18\xb7\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOptionsR\ - \x0benumdeclAll:Q\n\x14goproto_registration\x18\xb8\xec\x03\x20\x01(\x08\ - \x12\x1c.google.protobuf.FileOptionsR\x13goprotoRegistration:G\n\x0fmess\ - agename_all\x18\xb9\xec\x03\x20\x01(\x08\x12\x1c.google.protobuf.FileOpt\ - ionsR\x0emessagenameAll:R\n\x15goproto_sizecache_all\x18\xba\xec\x03\x20\ - \x01(\x08\x12\x1c.google.protobuf.FileOptionsR\x13goprotoSizecacheAll:N\ - \n\x13goproto_unkeyed_all\x18\xbb\xec\x03\x20\x01(\x08\x12\x1c.google.pr\ - otobuf.FileOptionsR\x11goprotoUnkeyedAll:J\n\x0fgoproto_getters\x18\x81\ - \xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0egoproto\ - Getters:L\n\x10goproto_stringer\x18\x83\xf4\x03\x20\x01(\x08\x12\x1f.goo\ - gle.protobuf.MessageOptionsR\x0fgoprotoStringer:F\n\rverbose_equal\x18\ - \x84\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0cver\ - boseEqual:5\n\x04face\x18\x85\xf4\x03\x20\x01(\x08\x12\x1f.google.protob\ - uf.MessageOptionsR\x04face:=\n\x08gostring\x18\x86\xf4\x03\x20\x01(\x08\ - \x12\x1f.google.protobuf.MessageOptionsR\x08gostring:=\n\x08populate\x18\ - \x87\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x08pop\ - ulate:=\n\x08stringer\x18\xc0\x8b\x04\x20\x01(\x08\x12\x1f.google.protob\ - uf.MessageOptionsR\x08stringer:;\n\x07onlyone\x18\x89\xf4\x03\x20\x01(\ - \x08\x12\x1f.google.protobuf.MessageOptionsR\x07onlyone:7\n\x05equal\x18\ - \x8d\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x05equ\ - al:C\n\x0bdescription\x18\x8e\xf4\x03\x20\x01(\x08\x12\x1f.google.protob\ - uf.MessageOptionsR\x0bdescription:;\n\x07testgen\x18\x8f\xf4\x03\x20\x01\ - (\x08\x12\x1f.google.protobuf.MessageOptionsR\x07testgen:=\n\x08benchgen\ - \x18\x90\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\ - \x08benchgen:?\n\tmarshaler\x18\x91\xf4\x03\x20\x01(\x08\x12\x1f.google.\ - protobuf.MessageOptionsR\tmarshaler:C\n\x0bunmarshaler\x18\x92\xf4\x03\ - \x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0bunmarshaler:L\n\ - \x10stable_marshaler\x18\x93\xf4\x03\x20\x01(\x08\x12\x1f.google.protobu\ - f.MessageOptionsR\x0fstableMarshaler:7\n\x05sizer\x18\x94\xf4\x03\x20\ - \x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x05sizer:L\n\x10unsafe\ - _marshaler\x18\x97\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageO\ - ptionsR\x0funsafeMarshaler:P\n\x12unsafe_unmarshaler\x18\x98\xf4\x03\x20\ - \x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x11unsafeUnmarshaler:W\ - \n\x16goproto_extensions_map\x18\x99\xf4\x03\x20\x01(\x08\x12\x1f.google\ - .protobuf.MessageOptionsR\x14goprotoExtensionsMap:T\n\x14goproto_unrecog\ - nized\x18\x9a\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOption\ - sR\x13goprotoUnrecognized:A\n\nprotosizer\x18\x9c\xf4\x03\x20\x01(\x08\ - \x12\x1f.google.protobuf.MessageOptionsR\nprotosizer:;\n\x07compare\x18\ - \x9d\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x07com\ - pare:=\n\x08typedecl\x18\x9e\xf4\x03\x20\x01(\x08\x12\x1f.google.protobu\ - f.MessageOptionsR\x08typedecl:C\n\x0bmessagename\x18\xa1\xf4\x03\x20\x01\ - (\x08\x12\x1f.google.protobuf.MessageOptionsR\x0bmessagename:N\n\x11gopr\ - oto_sizecache\x18\xa2\xf4\x03\x20\x01(\x08\x12\x1f.google.protobuf.Messa\ - geOptionsR\x10goprotoSizecache:J\n\x0fgoproto_unkeyed\x18\xa3\xf4\x03\ - \x20\x01(\x08\x12\x1f.google.protobuf.MessageOptionsR\x0egoprotoUnkeyed:\ - ;\n\x08nullable\x18\xe9\xfb\x03\x20\x01(\x08\x12\x1d.google.protobuf.Fie\ - ldOptionsR\x08nullable:5\n\x05embed\x18\xea\xfb\x03\x20\x01(\x08\x12\x1d\ - .google.protobuf.FieldOptionsR\x05embed:?\n\ncustomtype\x18\xeb\xfb\x03\ - \x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\ncustomtype:?\n\ncusto\ - mname\x18\xec\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\n\ - customname:9\n\x07jsontag\x18\xed\xfb\x03\x20\x01(\t\x12\x1d.google.prot\ - obuf.FieldOptionsR\x07jsontag:;\n\x08moretags\x18\xee\xfb\x03\x20\x01(\t\ - \x12\x1d.google.protobuf.FieldOptionsR\x08moretags:;\n\x08casttype\x18\ - \xef\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\x08casttyp\ - e:9\n\x07castkey\x18\xf0\xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.Fiel\ - dOptionsR\x07castkey:=\n\tcastvalue\x18\xf1\xfb\x03\x20\x01(\t\x12\x1d.g\ - oogle.protobuf.FieldOptionsR\tcastvalue:9\n\x07stdtime\x18\xf2\xfb\x03\ - \x20\x01(\x08\x12\x1d.google.protobuf.FieldOptionsR\x07stdtime:A\n\x0bst\ - dduration\x18\xf3\xfb\x03\x20\x01(\x08\x12\x1d.google.protobuf.FieldOpti\ - onsR\x0bstdduration:?\n\nwktpointer\x18\xf4\xfb\x03\x20\x01(\x08\x12\x1d\ - .google.protobuf.FieldOptionsR\nwktpointer:C\n\x0ccastrepeated\x18\xf5\ - \xfb\x03\x20\x01(\t\x12\x1d.google.protobuf.FieldOptionsR\x0ccastrepeate\ - dBH\n\x13com.google.protobufB\nGoGoProtosZ%github.com/cosmos/gogoproto/g\ - ogoprotoJ\xc17\n\x07\x12\x05\x1c\0\x90\x01\x01\n\xff\n\n\x01\x0c\x12\x03\ - \x1c\0\x122\xf4\n\x20Protocol\x20Buffers\x20for\x20Go\x20with\x20Gadgets\ - \n\n\x20Copyright\x20(c)\x202013,\x20The\x20GoGo\x20Authors.\x20All\x20r\ - ights\x20reserved.\n\x20http://github.com/cosmos/gogoproto\n\n\x20Redist\ - ribution\x20and\x20use\x20in\x20source\x20and\x20binary\x20forms,\x20wit\ - h\x20or\x20without\n\x20modification,\x20are\x20permitted\x20provided\ - \x20that\x20the\x20following\x20conditions\x20are\n\x20met:\n\n\x20\x20\ - \x20\x20\x20*\x20Redistributions\x20of\x20source\x20code\x20must\x20reta\ - in\x20the\x20above\x20copyright\n\x20notice,\x20this\x20list\x20of\x20co\ - nditions\x20and\x20the\x20following\x20disclaimer.\n\x20\x20\x20\x20\x20\ - *\x20Redistributions\x20in\x20binary\x20form\x20must\x20reproduce\x20the\ - \x20above\n\x20copyright\x20notice,\x20this\x20list\x20of\x20conditions\ - \x20and\x20the\x20following\x20disclaimer\n\x20in\x20the\x20documentatio\ - n\x20and/or\x20other\x20materials\x20provided\x20with\x20the\n\x20distri\ - bution.\n\n\x20THIS\x20SOFTWARE\x20IS\x20PROVIDED\x20BY\x20THE\x20COPYRI\ - GHT\x20HOLDERS\x20AND\x20CONTRIBUTORS\n\x20\"AS\x20IS\"\x20AND\x20ANY\ - \x20EXPRESS\x20OR\x20IMPLIED\x20WARRANTIES,\x20INCLUDING,\x20BUT\x20NOT\ - \n\x20LIMITED\x20TO,\x20THE\x20IMPLIED\x20WARRANTIES\x20OF\x20MERCHANTAB\ - ILITY\x20AND\x20FITNESS\x20FOR\n\x20A\x20PARTICULAR\x20PURPOSE\x20ARE\ - \x20DISCLAIMED.\x20IN\x20NO\x20EVENT\x20SHALL\x20THE\x20COPYRIGHT\n\x20O\ - WNER\x20OR\x20CONTRIBUTORS\x20BE\x20LIABLE\x20FOR\x20ANY\x20DIRECT,\x20I\ - NDIRECT,\x20INCIDENTAL,\n\x20SPECIAL,\x20EXEMPLARY,\x20OR\x20CONSEQUENTI\ - AL\x20DAMAGES\x20(INCLUDING,\x20BUT\x20NOT\n\x20LIMITED\x20TO,\x20PROCUR\ - EMENT\x20OF\x20SUBSTITUTE\x20GOODS\x20OR\x20SERVICES;\x20LOSS\x20OF\x20U\ - SE,\n\x20DATA,\x20OR\x20PROFITS;\x20OR\x20BUSINESS\x20INTERRUPTION)\x20H\ - OWEVER\x20CAUSED\x20AND\x20ON\x20ANY\n\x20THEORY\x20OF\x20LIABILITY,\x20\ - WHETHER\x20IN\x20CONTRACT,\x20STRICT\x20LIABILITY,\x20OR\x20TORT\n\x20(I\ - NCLUDING\x20NEGLIGENCE\x20OR\x20OTHERWISE)\x20ARISING\x20IN\x20ANY\x20WA\ - Y\x20OUT\x20OF\x20THE\x20USE\n\x20OF\x20THIS\x20SOFTWARE,\x20EVEN\x20IF\ - \x20ADVISED\x20OF\x20THE\x20POSSIBILITY\x20OF\x20SUCH\x20DAMAGE.\n\n\x08\ - \n\x01\x02\x12\x03\x1d\0\x12\n\t\n\x02\x03\0\x12\x03\x1f\0*\n\x08\n\x01\ - \x08\x12\x03!\0,\n\t\n\x02\x08\x01\x12\x03!\0,\n\x08\n\x01\x08\x12\x03\"\ - \0+\n\t\n\x02\x08\x08\x12\x03\"\0+\n\x08\n\x01\x08\x12\x03#\0<\n\t\n\x02\ - \x08\x0b\x12\x03#\0<\n\t\n\x01\x07\x12\x04%\0+\x01\n\t\n\x02\x07\0\x12\ - \x03&\x082\n\n\n\x03\x07\0\x02\x12\x03%\x07\"\n\n\n\x03\x07\0\x04\x12\ - \x03&\x08\x10\n\n\n\x03\x07\0\x05\x12\x03&\x11\x15\n\n\n\x03\x07\0\x01\ - \x12\x03&\x16)\n\n\n\x03\x07\0\x03\x12\x03&,1\n\t\n\x02\x07\x01\x12\x03'\ - \x084\n\n\n\x03\x07\x01\x02\x12\x03%\x07\"\n\n\n\x03\x07\x01\x04\x12\x03\ - '\x08\x10\n\n\n\x03\x07\x01\x05\x12\x03'\x11\x15\n\n\n\x03\x07\x01\x01\ - \x12\x03'\x16+\n\n\n\x03\x07\x01\x03\x12\x03'.3\n\t\n\x02\x07\x02\x12\ - \x03(\x08,\n\n\n\x03\x07\x02\x02\x12\x03%\x07\"\n\n\n\x03\x07\x02\x04\ - \x12\x03(\x08\x10\n\n\n\x03\x07\x02\x05\x12\x03(\x11\x15\n\n\n\x03\x07\ - \x02\x01\x12\x03(\x16#\n\n\n\x03\x07\x02\x03\x12\x03(&+\n\t\n\x02\x07\ - \x03\x12\x03)\x080\n\n\n\x03\x07\x03\x02\x12\x03%\x07\"\n\n\n\x03\x07\ - \x03\x04\x12\x03)\x08\x10\n\n\n\x03\x07\x03\x05\x12\x03)\x11\x17\n\n\n\ - \x03\x07\x03\x01\x12\x03)\x18'\n\n\n\x03\x07\x03\x03\x12\x03)*/\n\t\n\ - \x02\x07\x04\x12\x03*\x08'\n\n\n\x03\x07\x04\x02\x12\x03%\x07\"\n\n\n\ - \x03\x07\x04\x04\x12\x03*\x08\x10\n\n\n\x03\x07\x04\x05\x12\x03*\x11\x15\ - \n\n\n\x03\x07\x04\x01\x12\x03*\x16\x1e\n\n\n\x03\x07\x04\x03\x12\x03*!&\ - \n\t\n\x01\x07\x12\x04-\0/\x01\n\t\n\x02\x07\x05\x12\x03.\x085\n\n\n\x03\ - \x07\x05\x02\x12\x03-\x07'\n\n\n\x03\x07\x05\x04\x12\x03.\x08\x10\n\n\n\ - \x03\x07\x05\x05\x12\x03.\x11\x17\n\n\n\x03\x07\x05\x01\x12\x03.\x18,\n\ - \n\n\x03\x07\x05\x03\x12\x03./4\n\t\n\x01\x07\x12\x041\0Y\x01\n\t\n\x02\ - \x07\x06\x12\x032\x082\n\n\n\x03\x07\x06\x02\x12\x031\x07\"\n\n\n\x03\ - \x07\x06\x04\x12\x032\x08\x10\n\n\n\x03\x07\x06\x05\x12\x032\x11\x15\n\n\ - \n\x03\x07\x06\x01\x12\x032\x16)\n\n\n\x03\x07\x06\x03\x12\x032,1\n\t\n\ - \x02\x07\x07\x12\x033\x086\n\n\n\x03\x07\x07\x02\x12\x031\x07\"\n\n\n\ - \x03\x07\x07\x04\x12\x033\x08\x10\n\n\n\x03\x07\x07\x05\x12\x033\x11\x15\ - \n\n\n\x03\x07\x07\x01\x12\x033\x16-\n\n\n\x03\x07\x07\x03\x12\x03305\n\ - \t\n\x02\x07\x08\x12\x034\x083\n\n\n\x03\x07\x08\x02\x12\x031\x07\"\n\n\ - \n\x03\x07\x08\x04\x12\x034\x08\x10\n\n\n\x03\x07\x08\x05\x12\x034\x11\ - \x15\n\n\n\x03\x07\x08\x01\x12\x034\x16*\n\n\n\x03\x07\x08\x03\x12\x034-\ - 2\n\t\n\x02\x07\t\x12\x035\x080\n\n\n\x03\x07\t\x02\x12\x031\x07\"\n\n\n\ - \x03\x07\t\x04\x12\x035\x08\x10\n\n\n\x03\x07\t\x05\x12\x035\x11\x15\n\n\ - \n\x03\x07\t\x01\x12\x035\x16'\n\n\n\x03\x07\t\x03\x12\x035*/\n\t\n\x02\ - \x07\n\x12\x036\x08'\n\n\n\x03\x07\n\x02\x12\x031\x07\"\n\n\n\x03\x07\n\ - \x04\x12\x036\x08\x10\n\n\n\x03\x07\n\x05\x12\x036\x11\x15\n\n\n\x03\x07\ - \n\x01\x12\x036\x16\x1e\n\n\n\x03\x07\n\x03\x12\x036!&\n\t\n\x02\x07\x0b\ - \x12\x037\x08+\n\n\n\x03\x07\x0b\x02\x12\x031\x07\"\n\n\n\x03\x07\x0b\ - \x04\x12\x037\x08\x10\n\n\n\x03\x07\x0b\x05\x12\x037\x11\x15\n\n\n\x03\ - \x07\x0b\x01\x12\x037\x16\"\n\n\n\x03\x07\x0b\x03\x12\x037%*\n\t\n\x02\ - \x07\x0c\x12\x038\x08+\n\n\n\x03\x07\x0c\x02\x12\x031\x07\"\n\n\n\x03\ - \x07\x0c\x04\x12\x038\x08\x10\n\n\n\x03\x07\x0c\x05\x12\x038\x11\x15\n\n\ - \n\x03\x07\x0c\x01\x12\x038\x16\"\n\n\n\x03\x07\x0c\x03\x12\x038%*\n\t\n\ - \x02\x07\r\x12\x039\x08+\n\n\n\x03\x07\r\x02\x12\x031\x07\"\n\n\n\x03\ - \x07\r\x04\x12\x039\x08\x10\n\n\n\x03\x07\r\x05\x12\x039\x11\x15\n\n\n\ - \x03\x07\r\x01\x12\x039\x16\"\n\n\n\x03\x07\r\x03\x12\x039%*\n\t\n\x02\ - \x07\x0e\x12\x03:\x08*\n\n\n\x03\x07\x0e\x02\x12\x031\x07\"\n\n\n\x03\ - \x07\x0e\x04\x12\x03:\x08\x10\n\n\n\x03\x07\x0e\x05\x12\x03:\x11\x15\n\n\ - \n\x03\x07\x0e\x01\x12\x03:\x16!\n\n\n\x03\x07\x0e\x03\x12\x03:$)\n\t\n\ - \x02\x07\x0f\x12\x03<\x08(\n\n\n\x03\x07\x0f\x02\x12\x031\x07\"\n\n\n\ - \x03\x07\x0f\x04\x12\x03<\x08\x10\n\n\n\x03\x07\x0f\x05\x12\x03<\x11\x15\ - \n\n\n\x03\x07\x0f\x01\x12\x03<\x16\x1f\n\n\n\x03\x07\x0f\x03\x12\x03<\"\ - '\n\t\n\x02\x07\x10\x12\x03=\x08.\n\n\n\x03\x07\x10\x02\x12\x031\x07\"\n\ - \n\n\x03\x07\x10\x04\x12\x03=\x08\x10\n\n\n\x03\x07\x10\x05\x12\x03=\x11\ - \x15\n\n\n\x03\x07\x10\x01\x12\x03=\x16%\n\n\n\x03\x07\x10\x03\x12\x03=(\ - -\n\t\n\x02\x07\x11\x12\x03>\x08*\n\n\n\x03\x07\x11\x02\x12\x031\x07\"\n\ - \n\n\x03\x07\x11\x04\x12\x03>\x08\x10\n\n\n\x03\x07\x11\x05\x12\x03>\x11\ - \x15\n\n\n\x03\x07\x11\x01\x12\x03>\x16!\n\n\n\x03\x07\x11\x03\x12\x03>$\ - )\n\t\n\x02\x07\x12\x12\x03?\x08+\n\n\n\x03\x07\x12\x02\x12\x031\x07\"\n\ - \n\n\x03\x07\x12\x04\x12\x03?\x08\x10\n\n\n\x03\x07\x12\x05\x12\x03?\x11\ - \x15\n\n\n\x03\x07\x12\x01\x12\x03?\x16\"\n\n\n\x03\x07\x12\x03\x12\x03?\ - %*\n\t\n\x02\x07\x13\x12\x03@\x08,\n\n\n\x03\x07\x13\x02\x12\x031\x07\"\ - \n\n\n\x03\x07\x13\x04\x12\x03@\x08\x10\n\n\n\x03\x07\x13\x05\x12\x03@\ - \x11\x15\n\n\n\x03\x07\x13\x01\x12\x03@\x16#\n\n\n\x03\x07\x13\x03\x12\ - \x03@&+\n\t\n\x02\x07\x14\x12\x03A\x08.\n\n\n\x03\x07\x14\x02\x12\x031\ - \x07\"\n\n\n\x03\x07\x14\x04\x12\x03A\x08\x10\n\n\n\x03\x07\x14\x05\x12\ - \x03A\x11\x15\n\n\n\x03\x07\x14\x01\x12\x03A\x16%\n\n\n\x03\x07\x14\x03\ - \x12\x03A(-\n\t\n\x02\x07\x15\x12\x03B\x083\n\n\n\x03\x07\x15\x02\x12\ - \x031\x07\"\n\n\n\x03\x07\x15\x04\x12\x03B\x08\x10\n\n\n\x03\x07\x15\x05\ - \x12\x03B\x11\x15\n\n\n\x03\x07\x15\x01\x12\x03B\x16*\n\n\n\x03\x07\x15\ - \x03\x12\x03B-2\n\t\n\x02\x07\x16\x12\x03D\x08(\n\n\n\x03\x07\x16\x02\ - \x12\x031\x07\"\n\n\n\x03\x07\x16\x04\x12\x03D\x08\x10\n\n\n\x03\x07\x16\ - \x05\x12\x03D\x11\x15\n\n\n\x03\x07\x16\x01\x12\x03D\x16\x1f\n\n\n\x03\ - \x07\x16\x03\x12\x03D\"'\n\t\n\x02\x07\x17\x12\x03F\x088\n\n\n\x03\x07\ - \x17\x02\x12\x031\x07\"\n\n\n\x03\x07\x17\x04\x12\x03F\x08\x10\n\n\n\x03\ - \x07\x17\x05\x12\x03F\x11\x15\n\n\n\x03\x07\x17\x01\x12\x03F\x16/\n\n\n\ - \x03\x07\x17\x03\x12\x03F27\n\t\n\x02\x07\x18\x12\x03G\x080\n\n\n\x03\ - \x07\x18\x02\x12\x031\x07\"\n\n\n\x03\x07\x18\x04\x12\x03G\x08\x10\n\n\n\ - \x03\x07\x18\x05\x12\x03G\x11\x15\n\n\n\x03\x07\x18\x01\x12\x03G\x16'\n\ - \n\n\x03\x07\x18\x03\x12\x03G*/\n\t\n\x02\x07\x19\x12\x03I\x083\n\n\n\ - \x03\x07\x19\x02\x12\x031\x07\"\n\n\n\x03\x07\x19\x04\x12\x03I\x08\x10\n\ - \n\n\x03\x07\x19\x05\x12\x03I\x11\x15\n\n\n\x03\x07\x19\x01\x12\x03I\x16\ - *\n\n\n\x03\x07\x19\x03\x12\x03I-2\n\t\n\x02\x07\x1a\x12\x03J\x085\n\n\n\ - \x03\x07\x1a\x02\x12\x031\x07\"\n\n\n\x03\x07\x1a\x04\x12\x03J\x08\x10\n\ - \n\n\x03\x07\x1a\x05\x12\x03J\x11\x15\n\n\n\x03\x07\x1a\x01\x12\x03J\x16\ - ,\n\n\n\x03\x07\x1a\x03\x12\x03J/4\n\t\n\x02\x07\x1b\x12\x03L\x089\n\n\n\ - \x03\x07\x1b\x02\x12\x031\x07\"\n\n\n\x03\x07\x1b\x04\x12\x03L\x08\x10\n\ - \n\n\x03\x07\x1b\x05\x12\x03L\x11\x15\n\n\n\x03\x07\x1b\x01\x12\x03L\x16\ - 0\n\n\n\x03\x07\x1b\x03\x12\x03L38\n\t\n\x02\x07\x1c\x12\x03M\x087\n\n\n\ - \x03\x07\x1c\x02\x12\x031\x07\"\n\n\n\x03\x07\x1c\x04\x12\x03M\x08\x10\n\ - \n\n\x03\x07\x1c\x05\x12\x03M\x11\x15\n\n\n\x03\x07\x1c\x01\x12\x03M\x16\ - .\n\n\n\x03\x07\x1c\x03\x12\x03M16\n\t\n\x02\x07\x1d\x12\x03N\x08/\n\n\n\ - \x03\x07\x1d\x02\x12\x031\x07\"\n\n\n\x03\x07\x1d\x04\x12\x03N\x08\x10\n\ - \n\n\x03\x07\x1d\x05\x12\x03N\x11\x15\n\n\n\x03\x07\x1d\x01\x12\x03N\x16\ - &\n\n\n\x03\x07\x1d\x03\x12\x03N).\n\t\n\x02\x07\x1e\x12\x03O\x08-\n\n\n\ - \x03\x07\x1e\x02\x12\x031\x07\"\n\n\n\x03\x07\x1e\x04\x12\x03O\x08\x10\n\ - \n\n\x03\x07\x1e\x05\x12\x03O\x11\x15\n\n\n\x03\x07\x1e\x01\x12\x03O\x16\ - $\n\n\n\x03\x07\x1e\x03\x12\x03O',\n\t\n\x02\x07\x1f\x12\x03P\x08*\n\n\n\ - \x03\x07\x1f\x02\x12\x031\x07\"\n\n\n\x03\x07\x1f\x04\x12\x03P\x08\x10\n\ - \n\n\x03\x07\x1f\x05\x12\x03P\x11\x15\n\n\n\x03\x07\x1f\x01\x12\x03P\x16\ - !\n\n\n\x03\x07\x1f\x03\x12\x03P$)\n\t\n\x02\x07\x20\x12\x03Q\x04'\n\n\n\ - \x03\x07\x20\x02\x12\x031\x07\"\n\n\n\x03\x07\x20\x04\x12\x03Q\x04\x0c\n\ - \n\n\x03\x07\x20\x05\x12\x03Q\r\x11\n\n\n\x03\x07\x20\x01\x12\x03Q\x12\ - \x1e\n\n\n\x03\x07\x20\x03\x12\x03Q!&\n\t\n\x02\x07!\x12\x03R\x04'\n\n\n\ - \x03\x07!\x02\x12\x031\x07\"\n\n\n\x03\x07!\x04\x12\x03R\x04\x0c\n\n\n\ - \x03\x07!\x05\x12\x03R\r\x11\n\n\n\x03\x07!\x01\x12\x03R\x12\x1e\n\n\n\ - \x03\x07!\x03\x12\x03R!&\n\t\n\x02\x07\"\x12\x03T\x083\n\n\n\x03\x07\"\ - \x02\x12\x031\x07\"\n\n\n\x03\x07\"\x04\x12\x03T\x08\x10\n\n\n\x03\x07\"\ - \x05\x12\x03T\x11\x15\n\n\n\x03\x07\"\x01\x12\x03T\x16*\n\n\n\x03\x07\"\ - \x03\x12\x03T-2\n\t\n\x02\x07#\x12\x03U\x08.\n\n\n\x03\x07#\x02\x12\x031\ - \x07\"\n\n\n\x03\x07#\x04\x12\x03U\x08\x10\n\n\n\x03\x07#\x05\x12\x03U\ - \x11\x15\n\n\n\x03\x07#\x01\x12\x03U\x16%\n\n\n\x03\x07#\x03\x12\x03U(-\ - \n\t\n\x02\x07$\x12\x03W\x084\n\n\n\x03\x07$\x02\x12\x031\x07\"\n\n\n\ - \x03\x07$\x04\x12\x03W\x08\x10\n\n\n\x03\x07$\x05\x12\x03W\x11\x15\n\n\n\ - \x03\x07$\x01\x12\x03W\x16+\n\n\n\x03\x07$\x03\x12\x03W.3\n\t\n\x02\x07%\ - \x12\x03X\x082\n\n\n\x03\x07%\x02\x12\x031\x07\"\n\n\n\x03\x07%\x04\x12\ - \x03X\x08\x10\n\n\n\x03\x07%\x05\x12\x03X\x11\x15\n\n\n\x03\x07%\x01\x12\ - \x03X\x16)\n\n\n\x03\x07%\x03\x12\x03X,1\n\t\n\x01\x07\x12\x04[\0~\x01\n\ - \t\n\x02\x07&\x12\x03\\\x08.\n\n\n\x03\x07&\x02\x12\x03[\x07%\n\n\n\x03\ - \x07&\x04\x12\x03\\\x08\x10\n\n\n\x03\x07&\x05\x12\x03\\\x11\x15\n\n\n\ - \x03\x07&\x01\x12\x03\\\x16%\n\n\n\x03\x07&\x03\x12\x03\\(-\n\t\n\x02\ - \x07'\x12\x03]\x08/\n\n\n\x03\x07'\x02\x12\x03[\x07%\n\n\n\x03\x07'\x04\ - \x12\x03]\x08\x10\n\n\n\x03\x07'\x05\x12\x03]\x11\x15\n\n\n\x03\x07'\x01\ - \x12\x03]\x16&\n\n\n\x03\x07'\x03\x12\x03]).\n\t\n\x02\x07(\x12\x03^\x08\ - ,\n\n\n\x03\x07(\x02\x12\x03[\x07%\n\n\n\x03\x07(\x04\x12\x03^\x08\x10\n\ - \n\n\x03\x07(\x05\x12\x03^\x11\x15\n\n\n\x03\x07(\x01\x12\x03^\x16#\n\n\ - \n\x03\x07(\x03\x12\x03^&+\n\t\n\x02\x07)\x12\x03_\x08#\n\n\n\x03\x07)\ - \x02\x12\x03[\x07%\n\n\n\x03\x07)\x04\x12\x03_\x08\x10\n\n\n\x03\x07)\ - \x05\x12\x03_\x11\x15\n\n\n\x03\x07)\x01\x12\x03_\x16\x1a\n\n\n\x03\x07)\ - \x03\x12\x03_\x1d\"\n\t\n\x02\x07*\x12\x03`\x08'\n\n\n\x03\x07*\x02\x12\ - \x03[\x07%\n\n\n\x03\x07*\x04\x12\x03`\x08\x10\n\n\n\x03\x07*\x05\x12\ - \x03`\x11\x15\n\n\n\x03\x07*\x01\x12\x03`\x16\x1e\n\n\n\x03\x07*\x03\x12\ - \x03`!&\n\t\n\x02\x07+\x12\x03a\x08'\n\n\n\x03\x07+\x02\x12\x03[\x07%\n\ - \n\n\x03\x07+\x04\x12\x03a\x08\x10\n\n\n\x03\x07+\x05\x12\x03a\x11\x15\n\ - \n\n\x03\x07+\x01\x12\x03a\x16\x1e\n\n\n\x03\x07+\x03\x12\x03a!&\n\t\n\ - \x02\x07,\x12\x03b\x08'\n\n\n\x03\x07,\x02\x12\x03[\x07%\n\n\n\x03\x07,\ - \x04\x12\x03b\x08\x10\n\n\n\x03\x07,\x05\x12\x03b\x11\x15\n\n\n\x03\x07,\ - \x01\x12\x03b\x16\x1e\n\n\n\x03\x07,\x03\x12\x03b!&\n\t\n\x02\x07-\x12\ - \x03c\x08&\n\n\n\x03\x07-\x02\x12\x03[\x07%\n\n\n\x03\x07-\x04\x12\x03c\ - \x08\x10\n\n\n\x03\x07-\x05\x12\x03c\x11\x15\n\n\n\x03\x07-\x01\x12\x03c\ - \x16\x1d\n\n\n\x03\x07-\x03\x12\x03c\x20%\n\t\n\x02\x07.\x12\x03e\x08$\n\ - \n\n\x03\x07.\x02\x12\x03[\x07%\n\n\n\x03\x07.\x04\x12\x03e\x08\x10\n\n\ - \n\x03\x07.\x05\x12\x03e\x11\x15\n\n\n\x03\x07.\x01\x12\x03e\x16\x1b\n\n\ - \n\x03\x07.\x03\x12\x03e\x1e#\n\t\n\x02\x07/\x12\x03f\x08*\n\n\n\x03\x07\ - /\x02\x12\x03[\x07%\n\n\n\x03\x07/\x04\x12\x03f\x08\x10\n\n\n\x03\x07/\ - \x05\x12\x03f\x11\x15\n\n\n\x03\x07/\x01\x12\x03f\x16!\n\n\n\x03\x07/\ - \x03\x12\x03f$)\n\t\n\x02\x070\x12\x03g\x08&\n\n\n\x03\x070\x02\x12\x03[\ - \x07%\n\n\n\x03\x070\x04\x12\x03g\x08\x10\n\n\n\x03\x070\x05\x12\x03g\ - \x11\x15\n\n\n\x03\x070\x01\x12\x03g\x16\x1d\n\n\n\x03\x070\x03\x12\x03g\ - \x20%\n\t\n\x02\x071\x12\x03h\x08'\n\n\n\x03\x071\x02\x12\x03[\x07%\n\n\ - \n\x03\x071\x04\x12\x03h\x08\x10\n\n\n\x03\x071\x05\x12\x03h\x11\x15\n\n\ - \n\x03\x071\x01\x12\x03h\x16\x1e\n\n\n\x03\x071\x03\x12\x03h!&\n\t\n\x02\ - \x072\x12\x03i\x08(\n\n\n\x03\x072\x02\x12\x03[\x07%\n\n\n\x03\x072\x04\ - \x12\x03i\x08\x10\n\n\n\x03\x072\x05\x12\x03i\x11\x15\n\n\n\x03\x072\x01\ - \x12\x03i\x16\x1f\n\n\n\x03\x072\x03\x12\x03i\"'\n\t\n\x02\x073\x12\x03j\ - \x08*\n\n\n\x03\x073\x02\x12\x03[\x07%\n\n\n\x03\x073\x04\x12\x03j\x08\ - \x10\n\n\n\x03\x073\x05\x12\x03j\x11\x15\n\n\n\x03\x073\x01\x12\x03j\x16\ - !\n\n\n\x03\x073\x03\x12\x03j$)\n\t\n\x02\x074\x12\x03k\x08/\n\n\n\x03\ - \x074\x02\x12\x03[\x07%\n\n\n\x03\x074\x04\x12\x03k\x08\x10\n\n\n\x03\ - \x074\x05\x12\x03k\x11\x15\n\n\n\x03\x074\x01\x12\x03k\x16&\n\n\n\x03\ - \x074\x03\x12\x03k).\n\t\n\x02\x075\x12\x03m\x08$\n\n\n\x03\x075\x02\x12\ - \x03[\x07%\n\n\n\x03\x075\x04\x12\x03m\x08\x10\n\n\n\x03\x075\x05\x12\ - \x03m\x11\x15\n\n\n\x03\x075\x01\x12\x03m\x16\x1b\n\n\n\x03\x075\x03\x12\ - \x03m\x1e#\n\t\n\x02\x076\x12\x03o\x08/\n\n\n\x03\x076\x02\x12\x03[\x07%\ - \n\n\n\x03\x076\x04\x12\x03o\x08\x10\n\n\n\x03\x076\x05\x12\x03o\x11\x15\ - \n\n\n\x03\x076\x01\x12\x03o\x16&\n\n\n\x03\x076\x03\x12\x03o).\n\t\n\ - \x02\x077\x12\x03p\x081\n\n\n\x03\x077\x02\x12\x03[\x07%\n\n\n\x03\x077\ - \x04\x12\x03p\x08\x10\n\n\n\x03\x077\x05\x12\x03p\x11\x15\n\n\n\x03\x077\ - \x01\x12\x03p\x16(\n\n\n\x03\x077\x03\x12\x03p+0\n\t\n\x02\x078\x12\x03r\ - \x085\n\n\n\x03\x078\x02\x12\x03[\x07%\n\n\n\x03\x078\x04\x12\x03r\x08\ - \x10\n\n\n\x03\x078\x05\x12\x03r\x11\x15\n\n\n\x03\x078\x01\x12\x03r\x16\ - ,\n\n\n\x03\x078\x03\x12\x03r/4\n\t\n\x02\x079\x12\x03s\x083\n\n\n\x03\ - \x079\x02\x12\x03[\x07%\n\n\n\x03\x079\x04\x12\x03s\x08\x10\n\n\n\x03\ - \x079\x05\x12\x03s\x11\x15\n\n\n\x03\x079\x01\x12\x03s\x16*\n\n\n\x03\ - \x079\x03\x12\x03s-2\n\t\n\x02\x07:\x12\x03u\x08)\n\n\n\x03\x07:\x02\x12\ - \x03[\x07%\n\n\n\x03\x07:\x04\x12\x03u\x08\x10\n\n\n\x03\x07:\x05\x12\ - \x03u\x11\x15\n\n\n\x03\x07:\x01\x12\x03u\x16\x20\n\n\n\x03\x07:\x03\x12\ - \x03u#(\n\t\n\x02\x07;\x12\x03v\x08&\n\n\n\x03\x07;\x02\x12\x03[\x07%\n\ - \n\n\x03\x07;\x04\x12\x03v\x08\x10\n\n\n\x03\x07;\x05\x12\x03v\x11\x15\n\ - \n\n\x03\x07;\x01\x12\x03v\x16\x1d\n\n\n\x03\x07;\x03\x12\x03v\x20%\n\t\ - \n\x02\x07<\x12\x03x\x08'\n\n\n\x03\x07<\x02\x12\x03[\x07%\n\n\n\x03\x07\ - <\x04\x12\x03x\x08\x10\n\n\n\x03\x07<\x05\x12\x03x\x11\x15\n\n\n\x03\x07\ - <\x01\x12\x03x\x16\x1e\n\n\n\x03\x07<\x03\x12\x03x!&\n\t\n\x02\x07=\x12\ - \x03z\x08*\n\n\n\x03\x07=\x02\x12\x03[\x07%\n\n\n\x03\x07=\x04\x12\x03z\ - \x08\x10\n\n\n\x03\x07=\x05\x12\x03z\x11\x15\n\n\n\x03\x07=\x01\x12\x03z\ - \x16!\n\n\n\x03\x07=\x03\x12\x03z$)\n\t\n\x02\x07>\x12\x03|\x080\n\n\n\ - \x03\x07>\x02\x12\x03[\x07%\n\n\n\x03\x07>\x04\x12\x03|\x08\x10\n\n\n\ - \x03\x07>\x05\x12\x03|\x11\x15\n\n\n\x03\x07>\x01\x12\x03|\x16'\n\n\n\ - \x03\x07>\x03\x12\x03|*/\n\t\n\x02\x07?\x12\x03}\x08.\n\n\n\x03\x07?\x02\ - \x12\x03[\x07%\n\n\n\x03\x07?\x04\x12\x03}\x08\x10\n\n\n\x03\x07?\x05\ - \x12\x03}\x11\x15\n\n\n\x03\x07?\x01\x12\x03}\x16%\n\n\n\x03\x07?\x03\ - \x12\x03}(-\n\x0b\n\x01\x07\x12\x06\x80\x01\0\x90\x01\x01\n\n\n\x02\x07@\ - \x12\x04\x81\x01\x08'\n\x0b\n\x03\x07@\x02\x12\x04\x80\x01\x07#\n\x0b\n\ - \x03\x07@\x04\x12\x04\x81\x01\x08\x10\n\x0b\n\x03\x07@\x05\x12\x04\x81\ - \x01\x11\x15\n\x0b\n\x03\x07@\x01\x12\x04\x81\x01\x16\x1e\n\x0b\n\x03\ - \x07@\x03\x12\x04\x81\x01!&\n\n\n\x02\x07A\x12\x04\x82\x01\x08$\n\x0b\n\ - \x03\x07A\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07A\x04\x12\x04\x82\x01\ - \x08\x10\n\x0b\n\x03\x07A\x05\x12\x04\x82\x01\x11\x15\n\x0b\n\x03\x07A\ - \x01\x12\x04\x82\x01\x16\x1b\n\x0b\n\x03\x07A\x03\x12\x04\x82\x01\x1e#\n\ - \n\n\x02\x07B\x12\x04\x83\x01\x08+\n\x0b\n\x03\x07B\x02\x12\x04\x80\x01\ - \x07#\n\x0b\n\x03\x07B\x04\x12\x04\x83\x01\x08\x10\n\x0b\n\x03\x07B\x05\ - \x12\x04\x83\x01\x11\x17\n\x0b\n\x03\x07B\x01\x12\x04\x83\x01\x18\"\n\ - \x0b\n\x03\x07B\x03\x12\x04\x83\x01%*\n\n\n\x02\x07C\x12\x04\x84\x01\x08\ - +\n\x0b\n\x03\x07C\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07C\x04\x12\x04\ - \x84\x01\x08\x10\n\x0b\n\x03\x07C\x05\x12\x04\x84\x01\x11\x17\n\x0b\n\ - \x03\x07C\x01\x12\x04\x84\x01\x18\"\n\x0b\n\x03\x07C\x03\x12\x04\x84\x01\ - %*\n\n\n\x02\x07D\x12\x04\x85\x01\x08(\n\x0b\n\x03\x07D\x02\x12\x04\x80\ - \x01\x07#\n\x0b\n\x03\x07D\x04\x12\x04\x85\x01\x08\x10\n\x0b\n\x03\x07D\ - \x05\x12\x04\x85\x01\x11\x17\n\x0b\n\x03\x07D\x01\x12\x04\x85\x01\x18\ - \x1f\n\x0b\n\x03\x07D\x03\x12\x04\x85\x01\"'\n\n\n\x02\x07E\x12\x04\x86\ - \x01\x08)\n\x0b\n\x03\x07E\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07E\x04\ - \x12\x04\x86\x01\x08\x10\n\x0b\n\x03\x07E\x05\x12\x04\x86\x01\x11\x17\n\ - \x0b\n\x03\x07E\x01\x12\x04\x86\x01\x18\x20\n\x0b\n\x03\x07E\x03\x12\x04\ - \x86\x01#(\n\n\n\x02\x07F\x12\x04\x87\x01\x08)\n\x0b\n\x03\x07F\x02\x12\ - \x04\x80\x01\x07#\n\x0b\n\x03\x07F\x04\x12\x04\x87\x01\x08\x10\n\x0b\n\ - \x03\x07F\x05\x12\x04\x87\x01\x11\x17\n\x0b\n\x03\x07F\x01\x12\x04\x87\ - \x01\x18\x20\n\x0b\n\x03\x07F\x03\x12\x04\x87\x01#(\n\n\n\x02\x07G\x12\ - \x04\x88\x01\x08(\n\x0b\n\x03\x07G\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\ - \x07G\x04\x12\x04\x88\x01\x08\x10\n\x0b\n\x03\x07G\x05\x12\x04\x88\x01\ - \x11\x17\n\x0b\n\x03\x07G\x01\x12\x04\x88\x01\x18\x1f\n\x0b\n\x03\x07G\ - \x03\x12\x04\x88\x01\"'\n\n\n\x02\x07H\x12\x04\x89\x01\x08*\n\x0b\n\x03\ - \x07H\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07H\x04\x12\x04\x89\x01\x08\ - \x10\n\x0b\n\x03\x07H\x05\x12\x04\x89\x01\x11\x17\n\x0b\n\x03\x07H\x01\ - \x12\x04\x89\x01\x18!\n\x0b\n\x03\x07H\x03\x12\x04\x89\x01$)\n\n\n\x02\ - \x07I\x12\x04\x8b\x01\x08&\n\x0b\n\x03\x07I\x02\x12\x04\x80\x01\x07#\n\ - \x0b\n\x03\x07I\x04\x12\x04\x8b\x01\x08\x10\n\x0b\n\x03\x07I\x05\x12\x04\ - \x8b\x01\x11\x15\n\x0b\n\x03\x07I\x01\x12\x04\x8b\x01\x16\x1d\n\x0b\n\ - \x03\x07I\x03\x12\x04\x8b\x01\x20%\n\n\n\x02\x07J\x12\x04\x8c\x01\x08*\n\ - \x0b\n\x03\x07J\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07J\x04\x12\x04\ - \x8c\x01\x08\x10\n\x0b\n\x03\x07J\x05\x12\x04\x8c\x01\x11\x15\n\x0b\n\ - \x03\x07J\x01\x12\x04\x8c\x01\x16!\n\x0b\n\x03\x07J\x03\x12\x04\x8c\x01$\ - )\n\n\n\x02\x07K\x12\x04\x8d\x01\x08)\n\x0b\n\x03\x07K\x02\x12\x04\x80\ - \x01\x07#\n\x0b\n\x03\x07K\x04\x12\x04\x8d\x01\x08\x10\n\x0b\n\x03\x07K\ - \x05\x12\x04\x8d\x01\x11\x15\n\x0b\n\x03\x07K\x01\x12\x04\x8d\x01\x16\ - \x20\n\x0b\n\x03\x07K\x03\x12\x04\x8d\x01#(\n\n\n\x02\x07L\x12\x04\x8f\ - \x01\x08-\n\x0b\n\x03\x07L\x02\x12\x04\x80\x01\x07#\n\x0b\n\x03\x07L\x04\ - \x12\x04\x8f\x01\x08\x10\n\x0b\n\x03\x07L\x05\x12\x04\x8f\x01\x11\x17\n\ - \x0b\n\x03\x07L\x01\x12\x04\x8f\x01\x18$\n\x0b\n\x03\x07L\x03\x12\x04\ - \x8f\x01',\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(1); - deps.push(::protobuf::descriptor::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(0); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs b/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs deleted file mode 100644 index 4e01b326..00000000 --- a/packages/neutron-sdk/src/proto_types/limit_order_expiration.rs +++ /dev/null @@ -1,221 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/limit_order_expiration.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.LimitOrderExpiration) -pub struct LimitOrderExpiration { - // message fields - /// see limitOrderTranche.proto for details on goodTilDate - // @@protoc_insertion_point(field:neutron.dex.LimitOrderExpiration.expiration_time) - pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderExpiration.tranche_ref) - pub tranche_ref: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderExpiration.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a LimitOrderExpiration { - fn default() -> &'a LimitOrderExpiration { - ::default_instance() - } -} - -impl LimitOrderExpiration { - pub fn new() -> LimitOrderExpiration { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( - "expiration_time", - |m: &LimitOrderExpiration| { &m.expiration_time }, - |m: &mut LimitOrderExpiration| { &mut m.expiration_time }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tranche_ref", - |m: &LimitOrderExpiration| { &m.tranche_ref }, - |m: &mut LimitOrderExpiration| { &mut m.tranche_ref }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LimitOrderExpiration", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for LimitOrderExpiration { - const NAME: &'static str = "LimitOrderExpiration"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; - }, - 18 => { - self.tranche_ref = is.read_bytes()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.expiration_time.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.tranche_ref.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.tranche_ref); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.expiration_time.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if !self.tranche_ref.is_empty() { - os.write_bytes(2, &self.tranche_ref)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> LimitOrderExpiration { - LimitOrderExpiration::new() - } - - fn clear(&mut self) { - self.expiration_time.clear(); - self.tranche_ref.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static LimitOrderExpiration { - static instance: LimitOrderExpiration = LimitOrderExpiration { - expiration_time: ::protobuf::MessageField::none(), - tranche_ref: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for LimitOrderExpiration { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderExpiration").unwrap()).clone() - } -} - -impl ::std::fmt::Display for LimitOrderExpiration { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LimitOrderExpiration { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n(neutron/dex/limit_order_expiration.proto\x12\x0bneutron.dex\x1a\x1fgo\ - ogle/protobuf/timestamp.proto\x1a\x14gogoproto/gogo.proto\"\x86\x01\n\ - \x14LimitOrderExpiration\x12M\n\x0fexpiration_time\x18\x01\x20\x01(\x0b2\ - \x1a.google.protobuf.TimestampR\x0eexpirationTimeB\x08\x90\xdf\x1f\x01\ - \xc8\xde\x1f\0\x12\x1f\n\x0btranche_ref\x18\x02\x20\x01(\x0cR\ntrancheRe\ - fB,Z*github.com/neutron-org/neutron/x/dex/typesJ\xb9\x02\n\x06\x12\x04\0\ - \0\x10\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\ - \x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\ - \n\x02\x03\0\x12\x03\x04\0)\n\t\n\x02\x03\x01\x12\x03\x06\0\x1e\n\n\n\ - \x02\x04\0\x12\x04\x08\0\x10\x01\n\n\n\x03\x04\0\x01\x12\x03\x08\x08\x1c\ - \nF\n\x04\x04\0\x02\0\x12\x04\n\x02\r1\x1a8\x20see\x20limitOrderTranche.\ - proto\x20for\x20details\x20on\x20goodTilDate\n\n\x0c\n\x05\x04\0\x02\0\ - \x06\x12\x03\n\x02\x1b\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x1c+\n\x0c\ - \n\x05\x04\0\x02\0\x03\x12\x03\n./\n\r\n\x05\x04\0\x02\0\x08\x12\x04\n0\ - \r0\n\x0f\n\x08\x04\0\x02\0\x08\xf2\xfb\x03\x12\x03\x0b/I\n\x0f\n\x08\ - \x04\0\x02\0\x08\xe9\xfb\x03\x12\x03\x0c/K\n\x0b\n\x04\x04\0\x02\x01\x12\ - \x03\x0e\x02\x18\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x0e\x02\x07\n\x0c\ - \n\x05\x04\0\x02\x01\x01\x12\x03\x0e\x08\x13\n\x0c\n\x05\x04\0\x02\x01\ - \x03\x12\x03\x0e\x16\x17b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); - deps.push(super::gogo::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(LimitOrderExpiration::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs b/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs deleted file mode 100644 index 2b8cbfed..00000000 --- a/packages/neutron-sdk/src/proto_types/limit_order_tranche.rs +++ /dev/null @@ -1,550 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/limit_order_tranche.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.LimitOrderTrancheKey) -pub struct LimitOrderTrancheKey { - // message fields - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.trade_pair_id) - pub trade_pair_id: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.tick_index_taker_to_maker) - pub tick_index_taker_to_maker: i64, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheKey.tranche_key) - pub tranche_key: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTrancheKey.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a LimitOrderTrancheKey { - fn default() -> &'a LimitOrderTrancheKey { - ::default_instance() - } -} - -impl LimitOrderTrancheKey { - pub fn new() -> LimitOrderTrancheKey { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( - "trade_pair_id", - |m: &LimitOrderTrancheKey| { &m.trade_pair_id }, - |m: &mut LimitOrderTrancheKey| { &mut m.trade_pair_id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tick_index_taker_to_maker", - |m: &LimitOrderTrancheKey| { &m.tick_index_taker_to_maker }, - |m: &mut LimitOrderTrancheKey| { &mut m.tick_index_taker_to_maker }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tranche_key", - |m: &LimitOrderTrancheKey| { &m.tranche_key }, - |m: &mut LimitOrderTrancheKey| { &mut m.tranche_key }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LimitOrderTrancheKey", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for LimitOrderTrancheKey { - const NAME: &'static str = "LimitOrderTrancheKey"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; - }, - 16 => { - self.tick_index_taker_to_maker = is.read_int64()?; - }, - 26 => { - self.tranche_key = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.trade_pair_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if self.tick_index_taker_to_maker != 0 { - my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); - } - if !self.tranche_key.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.tranche_key); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.trade_pair_id.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if self.tick_index_taker_to_maker != 0 { - os.write_int64(2, self.tick_index_taker_to_maker)?; - } - if !self.tranche_key.is_empty() { - os.write_string(3, &self.tranche_key)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> LimitOrderTrancheKey { - LimitOrderTrancheKey::new() - } - - fn clear(&mut self) { - self.trade_pair_id.clear(); - self.tick_index_taker_to_maker = 0; - self.tranche_key.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static LimitOrderTrancheKey { - static instance: LimitOrderTrancheKey = LimitOrderTrancheKey { - trade_pair_id: ::protobuf::MessageField::none(), - tick_index_taker_to_maker: 0, - tranche_key: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for LimitOrderTrancheKey { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTrancheKey").unwrap()).clone() - } -} - -impl ::std::fmt::Display for LimitOrderTrancheKey { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LimitOrderTrancheKey { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.LimitOrderTranche) -pub struct LimitOrderTranche { - // message fields - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.key) - pub key: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.reserves_maker_denom) - pub reserves_maker_denom: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.reserves_taker_denom) - pub reserves_taker_denom: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.total_maker_denom) - pub total_maker_denom: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.total_taker_denom) - pub total_taker_denom: ::std::string::String, - /// JIT orders also use goodTilDate to handle deletion but represent a special case - /// All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live - /// Order deletion still functions the same and the orders will be deleted at the end of the block - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.expiration_time) - pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTranche.price_taker_to_maker) - pub price_taker_to_maker: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTranche.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a LimitOrderTranche { - fn default() -> &'a LimitOrderTranche { - ::default_instance() - } -} - -impl LimitOrderTranche { - pub fn new() -> LimitOrderTranche { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(7); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, LimitOrderTrancheKey>( - "key", - |m: &LimitOrderTranche| { &m.key }, - |m: &mut LimitOrderTranche| { &mut m.key }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "reserves_maker_denom", - |m: &LimitOrderTranche| { &m.reserves_maker_denom }, - |m: &mut LimitOrderTranche| { &mut m.reserves_maker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "reserves_taker_denom", - |m: &LimitOrderTranche| { &m.reserves_taker_denom }, - |m: &mut LimitOrderTranche| { &mut m.reserves_taker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "total_maker_denom", - |m: &LimitOrderTranche| { &m.total_maker_denom }, - |m: &mut LimitOrderTranche| { &mut m.total_maker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "total_taker_denom", - |m: &LimitOrderTranche| { &m.total_taker_denom }, - |m: &mut LimitOrderTranche| { &mut m.total_taker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( - "expiration_time", - |m: &LimitOrderTranche| { &m.expiration_time }, - |m: &mut LimitOrderTranche| { &mut m.expiration_time }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "price_taker_to_maker", - |m: &LimitOrderTranche| { &m.price_taker_to_maker }, - |m: &mut LimitOrderTranche| { &mut m.price_taker_to_maker }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LimitOrderTranche", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for LimitOrderTranche { - const NAME: &'static str = "LimitOrderTranche"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.key)?; - }, - 18 => { - self.reserves_maker_denom = is.read_string()?; - }, - 26 => { - self.reserves_taker_denom = is.read_string()?; - }, - 34 => { - self.total_maker_denom = is.read_string()?; - }, - 42 => { - self.total_taker_denom = is.read_string()?; - }, - 50 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; - }, - 58 => { - self.price_taker_to_maker = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.key.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.reserves_maker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.reserves_maker_denom); - } - if !self.reserves_taker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.reserves_taker_denom); - } - if !self.total_maker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.total_maker_denom); - } - if !self.total_taker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.total_taker_denom); - } - if let Some(v) = self.expiration_time.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.price_taker_to_maker.is_empty() { - my_size += ::protobuf::rt::string_size(7, &self.price_taker_to_maker); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.key.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if !self.reserves_maker_denom.is_empty() { - os.write_string(2, &self.reserves_maker_denom)?; - } - if !self.reserves_taker_denom.is_empty() { - os.write_string(3, &self.reserves_taker_denom)?; - } - if !self.total_maker_denom.is_empty() { - os.write_string(4, &self.total_maker_denom)?; - } - if !self.total_taker_denom.is_empty() { - os.write_string(5, &self.total_taker_denom)?; - } - if let Some(v) = self.expiration_time.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; - } - if !self.price_taker_to_maker.is_empty() { - os.write_string(7, &self.price_taker_to_maker)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> LimitOrderTranche { - LimitOrderTranche::new() - } - - fn clear(&mut self) { - self.key.clear(); - self.reserves_maker_denom.clear(); - self.reserves_taker_denom.clear(); - self.total_maker_denom.clear(); - self.total_taker_denom.clear(); - self.expiration_time.clear(); - self.price_taker_to_maker.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static LimitOrderTranche { - static instance: LimitOrderTranche = LimitOrderTranche { - key: ::protobuf::MessageField::none(), - reserves_maker_denom: ::std::string::String::new(), - reserves_taker_denom: ::std::string::String::new(), - total_maker_denom: ::std::string::String::new(), - total_taker_denom: ::std::string::String::new(), - expiration_time: ::protobuf::MessageField::none(), - price_taker_to_maker: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for LimitOrderTranche { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTranche").unwrap()).clone() - } -} - -impl ::std::fmt::Display for LimitOrderTranche { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LimitOrderTranche { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n%neutron/dex/limit_order_tranche.proto\x12\x0bneutron.dex\x1a\x1fgoogl\ - e/protobuf/timestamp.proto\x1a\x1fneutron/dex/trade_pair_id.proto\x1a\ - \x14gogoproto/gogo.proto\x1a\x19neutron/dex/pair_id.proto\"\xaf\x01\n\ - \x14LimitOrderTrancheKey\x12<\n\rtrade_pair_id\x18\x01\x20\x01(\x0b2\x18\ - .neutron.dex.TradePairIDR\x0btradePairId\x128\n\x19tick_index_taker_to_m\ - aker\x18\x02\x20\x01(\x03R\x15tickIndexTakerToMaker\x12\x1f\n\x0btranche\ - _key\x18\x03\x20\x01(\tR\ntrancheKey\"\x8b\x07\n\x11LimitOrderTranche\ - \x123\n\x03key\x18\x01\x20\x01(\x0b2!.neutron.dex.LimitOrderTrancheKeyR\ - \x03key\x12\x97\x01\n\x14reserves_maker_denom\x18\x02\x20\x01(\tR\x12res\ - ervesMakerDenomBe\xf2\xde\x1f\x1byaml:\"reserves_maker_denom\"\xda\xde\ - \x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\ - \x14reserves_maker_denom\x12\x97\x01\n\x14reserves_taker_denom\x18\x03\ - \x20\x01(\tR\x12reservesTakerDenomBe\xf2\xde\x1f\x1byaml:\"reserves_take\ - r_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\ - \0\xea\xde\x1f\x14reserves_taker_denom\x12\x8b\x01\n\x11total_maker_deno\ - m\x18\x04\x20\x01(\tR\x0ftotalMakerDenomB_\xf2\xde\x1f\x18yaml:\"total_m\ - aker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\ - \x1f\0\xea\xde\x1f\x11total_maker_denom\x12\x8b\x01\n\x11total_taker_den\ - om\x18\x05\x20\x01(\tR\x0ftotalTakerDenomB_\xf2\xde\x1f\x18yaml:\"total_\ - taker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\ - \x1f\0\xea\xde\x1f\x11total_taker_denom\x12M\n\x0fexpiration_time\x18\ - \x06\x20\x01(\x0b2\x1a.google.protobuf.TimestampR\x0eexpirationTimeB\x08\ - \x90\xdf\x1f\x01\xc8\xde\x1f\x01\x12\xa1\x01\n\x14price_taker_to_maker\ - \x18\x07\x20\x01(\tR\x11priceTakerToMakerBp\xf2\xde\x1f\x1byaml:\"price_\ - taker_to_maker\"\xda\xde\x1f1github.com/neutron-org/neutron/utils/math.P\ - recDec\xc8\xde\x1f\0\xea\xde\x1f\x14price_taker_to_makerB,Z*github.com/n\ - eutron-org/neutron/x/dex/typesJ\xce\x0c\n\x06\x12\x04\0\0:\x01\n\x08\n\ - \x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\ - \x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\ - \x03\x04\0)\n\t\n\x02\x03\x01\x12\x03\x06\0)\n\t\n\x02\x03\x02\x12\x03\ - \x07\0\x1e\n\t\n\x02\x03\x03\x12\x03\x08\0#\n\n\n\x02\x04\0\x12\x04\n\0\ - \x0e\x01\n\n\n\x03\x04\0\x01\x12\x03\n\x08\x1c\n\x0b\n\x04\x04\0\x02\0\ - \x12\x03\x0b\x02\x20\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0b\x02\r\n\x0c\ - \n\x05\x04\0\x02\0\x01\x12\x03\x0b\x0e\x1b\n\x0c\n\x05\x04\0\x02\0\x03\ - \x12\x03\x0b\x1e\x1f\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0c\x02&\n\x0c\n\ - \x05\x04\0\x02\x01\x05\x12\x03\x0c\x02\x07\n\x0c\n\x05\x04\0\x02\x01\x01\ - \x12\x03\x0c\x08!\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0c$%\n\x0b\n\ - \x04\x04\0\x02\x02\x12\x03\r\x02\x19\n\x0c\n\x05\x04\0\x02\x02\x05\x12\ - \x03\r\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\r\t\x14\n\x0c\n\x05\ - \x04\0\x02\x02\x03\x12\x03\r\x17\x18\n\n\n\x02\x04\x01\x12\x04\x10\0:\ - \x01\n\n\n\x03\x04\x01\x01\x12\x03\x10\x08\x19\n\x0b\n\x04\x04\x01\x02\0\ - \x12\x03\x11\x02\x1f\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x11\x02\x16\n\ - \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x11\x17\x1a\n\x0c\n\x05\x04\x01\x02\ - \0\x03\x12\x03\x11\x1d\x1e\n\x0c\n\x04\x04\x01\x02\x01\x12\x04\x12\x02\ - \x17\x04\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x12\x02\x08\n\x0c\n\x05\ - \x04\x01\x02\x01\x01\x12\x03\x12\t\x1d\n\x0c\n\x05\x04\x01\x02\x01\x03\ - \x12\x03\x12\x20!\n\r\n\x05\x04\x01\x02\x01\x08\x12\x04\x12#\x17\x03\n\ - \x0f\n\x08\x04\x01\x02\x01\x08\xee\xfb\x03\x12\x03\x13\x06>\n\x0f\n\x08\ - \x04\x01\x02\x01\x08\xeb\xfb\x03\x12\x03\x14\x06G\n\x0f\n\x08\x04\x01\ - \x02\x01\x08\xe9\xfb\x03\x12\x03\x15\x06$\n\x0f\n\x08\x04\x01\x02\x01\ - \x08\xed\xfb\x03\x12\x03\x16\x062\n\x0c\n\x04\x04\x01\x02\x02\x12\x04\ - \x18\x02\x1d\x04\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x18\x02\x08\n\ - \x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x18\t\x1d\n\x0c\n\x05\x04\x01\x02\ - \x02\x03\x12\x03\x18\x20!\n\r\n\x05\x04\x01\x02\x02\x08\x12\x04\x18#\x1d\ - \x03\n\x0f\n\x08\x04\x01\x02\x02\x08\xee\xfb\x03\x12\x03\x19\x06>\n\x0f\ - \n\x08\x04\x01\x02\x02\x08\xeb\xfb\x03\x12\x03\x1a\x06G\n\x0f\n\x08\x04\ - \x01\x02\x02\x08\xe9\xfb\x03\x12\x03\x1b\x06$\n\x0f\n\x08\x04\x01\x02\ - \x02\x08\xed\xfb\x03\x12\x03\x1c\x062\n\x0c\n\x04\x04\x01\x02\x03\x12\ - \x04\x1e\x02#\x04\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x1e\x02\x08\n\ - \x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x1e\t\x1a\n\x0c\n\x05\x04\x01\x02\ - \x03\x03\x12\x03\x1e\x1d\x1e\n\r\n\x05\x04\x01\x02\x03\x08\x12\x04\x1e\ - \x20#\x03\n\x0f\n\x08\x04\x01\x02\x03\x08\xee\xfb\x03\x12\x03\x1f\x06;\n\ - \x0f\n\x08\x04\x01\x02\x03\x08\xeb\xfb\x03\x12\x03\x20\x06G\n\x0f\n\x08\ - \x04\x01\x02\x03\x08\xe9\xfb\x03\x12\x03!\x06$\n\x0f\n\x08\x04\x01\x02\ - \x03\x08\xed\xfb\x03\x12\x03\"\x06/\n\xb0\x01\n\x04\x04\x01\x02\x04\x12\ - \x04$\x02)\x04\"\xa1\x01\x20GoodTilDate\x20is\x20represented\x20as\x20se\ - conds\x20since\x20\x20January\x201,\x20year\x201,\x2000:00:00.00\x20UTC\ - \n\x20LimitOrders\x20with\x20goodTilDate\x20set\x20are\x20valid\x20as\ - \x20long\x20as\x20blockTime\x20<=\x20goodTilDate\n\n\x0c\n\x05\x04\x01\ - \x02\x04\x05\x12\x03$\x02\x08\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03$\t\ - \x1a\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03$\x1d\x1e\n\r\n\x05\x04\x01\ - \x02\x04\x08\x12\x04$\x20)\x03\n\x0f\n\x08\x04\x01\x02\x04\x08\xee\xfb\ - \x03\x12\x03%\x06;\n\x0f\n\x08\x04\x01\x02\x04\x08\xeb\xfb\x03\x12\x03&\ - \x06G\n\x0f\n\x08\x04\x01\x02\x04\x08\xe9\xfb\x03\x12\x03'\x06$\n\x0f\n\ - \x08\x04\x01\x02\x04\x08\xed\xfb\x03\x12\x03(\x06/\n\xab\x02\n\x04\x04\ - \x01\x02\x05\x12\x040\x023/\x1a\x9c\x02\x20JIT\x20orders\x20also\x20use\ - \x20goodTilDate\x20to\x20handle\x20deletion\x20but\x20represent\x20a\x20\ - special\x20case\n\x20All\x20JIT\x20orders\x20have\x20a\x20goodTilDate\ - \x20of\x200\x20and\x20an\x20exception\x20is\x20made\x20to\x20still\x20st\ - ill\x20treat\x20these\x20orders\x20as\x20live\n\x20Order\x20deletion\x20\ - still\x20functions\x20the\x20same\x20and\x20the\x20orders\x20will\x20be\ - \x20deleted\x20at\x20the\x20end\x20of\x20the\x20block\n\n\x0c\n\x05\x04\ - \x01\x02\x05\x06\x12\x030\x02\x1b\n\x0c\n\x05\x04\x01\x02\x05\x01\x12\ - \x030\x1c+\n\x0c\n\x05\x04\x01\x02\x05\x03\x12\x030./\n\r\n\x05\x04\x01\ - \x02\x05\x08\x12\x04003.\n\x0f\n\x08\x04\x01\x02\x05\x08\xf2\xfb\x03\x12\ - \x031-G\n\x0f\n\x08\x04\x01\x02\x05\x08\xe9\xfb\x03\x12\x032-H\n\x0c\n\ - \x04\x04\x01\x02\x06\x12\x044\x029\x12\n\x0c\n\x05\x04\x01\x02\x06\x05\ - \x12\x034\x02\x08\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x034\t\x1d\n\x0c\n\ - \x05\x04\x01\x02\x06\x03\x12\x034\x20!\n\r\n\x05\x04\x01\x02\x06\x08\x12\ - \x044\"9\x11\n\x0f\n\x08\x04\x01\x02\x06\x08\xee\xfb\x03\x12\x035\x10H\n\ - \x0f\n\x08\x04\x01\x02\x06\x08\xeb\xfb\x03\x12\x036\x10\\\n\x0f\n\x08\ - \x04\x01\x02\x06\x08\xe9\xfb\x03\x12\x037\x10.\n\x0f\n\x08\x04\x01\x02\ - \x06\x08\xed\xfb\x03\x12\x038\x10 &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(4); - deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); - deps.push(super::trade_pair_id::file_descriptor().clone()); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::pair_id::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(2); - messages.push(LimitOrderTrancheKey::generated_message_descriptor_data()); - messages.push(LimitOrderTranche::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs b/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs deleted file mode 100644 index e5b2070a..00000000 --- a/packages/neutron-sdk/src/proto_types/limit_order_tranche_user.rs +++ /dev/null @@ -1,366 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/limit_order_tranche_user.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.LimitOrderTrancheUser) -pub struct LimitOrderTrancheUser { - // message fields - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.trade_pair_id) - pub trade_pair_id: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.tick_index_taker_to_maker) - pub tick_index_taker_to_maker: i64, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.tranche_key) - pub tranche_key: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.address) - pub address: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_owned) - pub shares_owned: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_withdrawn) - pub shares_withdrawn: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.shares_cancelled) - pub shares_cancelled: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.LimitOrderTrancheUser.order_type) - pub order_type: ::protobuf::EnumOrUnknown, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.LimitOrderTrancheUser.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a LimitOrderTrancheUser { - fn default() -> &'a LimitOrderTrancheUser { - ::default_instance() - } -} - -impl LimitOrderTrancheUser { - pub fn new() -> LimitOrderTrancheUser { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(8); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( - "trade_pair_id", - |m: &LimitOrderTrancheUser| { &m.trade_pair_id }, - |m: &mut LimitOrderTrancheUser| { &mut m.trade_pair_id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tick_index_taker_to_maker", - |m: &LimitOrderTrancheUser| { &m.tick_index_taker_to_maker }, - |m: &mut LimitOrderTrancheUser| { &mut m.tick_index_taker_to_maker }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tranche_key", - |m: &LimitOrderTrancheUser| { &m.tranche_key }, - |m: &mut LimitOrderTrancheUser| { &mut m.tranche_key }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "address", - |m: &LimitOrderTrancheUser| { &m.address }, - |m: &mut LimitOrderTrancheUser| { &mut m.address }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "shares_owned", - |m: &LimitOrderTrancheUser| { &m.shares_owned }, - |m: &mut LimitOrderTrancheUser| { &mut m.shares_owned }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "shares_withdrawn", - |m: &LimitOrderTrancheUser| { &m.shares_withdrawn }, - |m: &mut LimitOrderTrancheUser| { &mut m.shares_withdrawn }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "shares_cancelled", - |m: &LimitOrderTrancheUser| { &m.shares_cancelled }, - |m: &mut LimitOrderTrancheUser| { &mut m.shares_cancelled }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "order_type", - |m: &LimitOrderTrancheUser| { &m.order_type }, - |m: &mut LimitOrderTrancheUser| { &mut m.order_type }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "LimitOrderTrancheUser", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for LimitOrderTrancheUser { - const NAME: &'static str = "LimitOrderTrancheUser"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; - }, - 16 => { - self.tick_index_taker_to_maker = is.read_int64()?; - }, - 26 => { - self.tranche_key = is.read_string()?; - }, - 34 => { - self.address = is.read_string()?; - }, - 42 => { - self.shares_owned = is.read_string()?; - }, - 50 => { - self.shares_withdrawn = is.read_string()?; - }, - 58 => { - self.shares_cancelled = is.read_string()?; - }, - 64 => { - self.order_type = is.read_enum_or_unknown()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.trade_pair_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if self.tick_index_taker_to_maker != 0 { - my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); - } - if !self.tranche_key.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.tranche_key); - } - if !self.address.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.address); - } - if !self.shares_owned.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.shares_owned); - } - if !self.shares_withdrawn.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.shares_withdrawn); - } - if !self.shares_cancelled.is_empty() { - my_size += ::protobuf::rt::string_size(7, &self.shares_cancelled); - } - if self.order_type != ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED) { - my_size += ::protobuf::rt::int32_size(8, self.order_type.value()); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.trade_pair_id.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if self.tick_index_taker_to_maker != 0 { - os.write_int64(2, self.tick_index_taker_to_maker)?; - } - if !self.tranche_key.is_empty() { - os.write_string(3, &self.tranche_key)?; - } - if !self.address.is_empty() { - os.write_string(4, &self.address)?; - } - if !self.shares_owned.is_empty() { - os.write_string(5, &self.shares_owned)?; - } - if !self.shares_withdrawn.is_empty() { - os.write_string(6, &self.shares_withdrawn)?; - } - if !self.shares_cancelled.is_empty() { - os.write_string(7, &self.shares_cancelled)?; - } - if self.order_type != ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED) { - os.write_enum(8, ::protobuf::EnumOrUnknown::value(&self.order_type))?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> LimitOrderTrancheUser { - LimitOrderTrancheUser::new() - } - - fn clear(&mut self) { - self.trade_pair_id.clear(); - self.tick_index_taker_to_maker = 0; - self.tranche_key.clear(); - self.address.clear(); - self.shares_owned.clear(); - self.shares_withdrawn.clear(); - self.shares_cancelled.clear(); - self.order_type = ::protobuf::EnumOrUnknown::new(super::tx::LimitOrderType::GOOD_TIL_CANCELLED); - self.special_fields.clear(); - } - - fn default_instance() -> &'static LimitOrderTrancheUser { - static instance: LimitOrderTrancheUser = LimitOrderTrancheUser { - trade_pair_id: ::protobuf::MessageField::none(), - tick_index_taker_to_maker: 0, - tranche_key: ::std::string::String::new(), - address: ::std::string::String::new(), - shares_owned: ::std::string::String::new(), - shares_withdrawn: ::std::string::String::new(), - shares_cancelled: ::std::string::String::new(), - order_type: ::protobuf::EnumOrUnknown::from_i32(0), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for LimitOrderTrancheUser { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("LimitOrderTrancheUser").unwrap()).clone() - } -} - -impl ::std::fmt::Display for LimitOrderTrancheUser { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LimitOrderTrancheUser { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n*neutron/dex/limit_order_tranche_user.proto\x12\x0bneutron.dex\x1a\x14\ - gogoproto/gogo.proto\x1a\x1fneutron/dex/trade_pair_id.proto\x1a\x14neutr\ - on/dex/tx.proto\"\x96\x05\n\x15LimitOrderTrancheUser\x12<\n\rtrade_pair_\ - id\x18\x01\x20\x01(\x0b2\x18.neutron.dex.TradePairIDR\x0btradePairId\x12\ - 8\n\x19tick_index_taker_to_maker\x18\x02\x20\x01(\x03R\x15tickIndexTaker\ - ToMaker\x12\x1f\n\x0btranche_key\x18\x03\x20\x01(\tR\ntrancheKey\x12\x18\ - \n\x07address\x18\x04\x20\x01(\tR\x07address\x12x\n\x0cshares_owned\x18\ - \x05\x20\x01(\tR\x0bsharesOwnedBU\xf2\xde\x1f\x13yaml:\"shares_owned\"\ - \xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ - \xde\x1f\x0cshares_owned\x12\x88\x01\n\x10shares_withdrawn\x18\x06\x20\ - \x01(\tR\x0fsharesWithdrawnB]\xf2\xde\x1f\x17yaml:\"shares_withdrawn\"\ - \xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ - \xde\x1f\x10shares_withdrawn\x12\x88\x01\n\x10shares_cancelled\x18\x07\ - \x20\x01(\tR\x0fsharesCancelledB]\xf2\xde\x1f\x17yaml:\"shares_cancelled\ - \"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\ - \xde\x1f\x10shares_cancelled\x12:\n\norder_type\x18\x08\x20\x01(\x0e2\ - \x1b.neutron.dex.LimitOrderTypeR\torderTypeB,Z*github.com/neutron-org/ne\ - utron/x/dex/typesJ\x9e\x06\n\x06\x12\x04\0\0\x20\x01\n\x08\n\x01\x0c\x12\ - \x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\ - \x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x04\0\ - \x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\t\n\x02\x03\x02\x12\x03\x06\0\ - \x1e\n\n\n\x02\x04\0\x12\x04\x08\0\x20\x01\n\n\n\x03\x04\0\x01\x12\x03\ - \x08\x08\x1d\n\x0b\n\x04\x04\0\x02\0\x12\x03\t\x02\x20\n\x0c\n\x05\x04\0\ - \x02\0\x06\x12\x03\t\x02\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\t\x0e\x1b\ - \n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\t\x1e\x1f\n\x0b\n\x04\x04\0\x02\x01\ - \x12\x03\n\x02&\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\n\x02\x07\n\x0c\n\ - \x05\x04\0\x02\x01\x01\x12\x03\n\x08!\n\x0c\n\x05\x04\0\x02\x01\x03\x12\ - \x03\n$%\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x0b\x02\x19\n\x0c\n\x05\x04\0\ - \x02\x02\x05\x12\x03\x0b\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\ - \x0b\t\x14\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x0b\x17\x18\n\x0b\n\x04\ - \x04\0\x02\x03\x12\x03\x0c\x02\x15\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\ - \x0c\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x0c\t\x10\n\x0c\n\x05\ - \x04\0\x02\x03\x03\x12\x03\x0c\x13\x14\n\x0c\n\x04\x04\0\x02\x04\x12\x04\ - \r\x02\x12\x04\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\r\x02\x08\n\x0c\n\ - \x05\x04\0\x02\x04\x01\x12\x03\r\t\x15\n\x0c\n\x05\x04\0\x02\x04\x03\x12\ - \x03\r\x18\x19\n\r\n\x05\x04\0\x02\x04\x08\x12\x04\r\x1b\x12\x03\n\x0f\n\ - \x08\x04\0\x02\x04\x08\xee\xfb\x03\x12\x03\x0e\x066\n\x0f\n\x08\x04\0\ - \x02\x04\x08\xeb\xfb\x03\x12\x03\x0f\x06G\n\x0f\n\x08\x04\0\x02\x04\x08\ - \xe9\xfb\x03\x12\x03\x10\x06$\n\x0f\n\x08\x04\0\x02\x04\x08\xed\xfb\x03\ - \x12\x03\x11\x06*\n\x0c\n\x04\x04\0\x02\x05\x12\x04\x13\x02\x18\x04\n\ - \x0c\n\x05\x04\0\x02\x05\x05\x12\x03\x13\x02\x08\n\x0c\n\x05\x04\0\x02\ - \x05\x01\x12\x03\x13\t\x19\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x13\x1c\ - \x1d\n\r\n\x05\x04\0\x02\x05\x08\x12\x04\x13\x1f\x18\x03\n\x0f\n\x08\x04\ - \0\x02\x05\x08\xee\xfb\x03\x12\x03\x14\x06:\n\x0f\n\x08\x04\0\x02\x05\ - \x08\xeb\xfb\x03\x12\x03\x15\x06G\n\x0f\n\x08\x04\0\x02\x05\x08\xe9\xfb\ - \x03\x12\x03\x16\x06$\n\x0f\n\x08\x04\0\x02\x05\x08\xed\xfb\x03\x12\x03\ - \x17\x06.\n\x0c\n\x04\x04\0\x02\x06\x12\x04\x19\x02\x1e\x04\n\x0c\n\x05\ - \x04\0\x02\x06\x05\x12\x03\x19\x02\x08\n\x0c\n\x05\x04\0\x02\x06\x01\x12\ - \x03\x19\t\x19\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\x19\x1c\x1d\n\r\n\ - \x05\x04\0\x02\x06\x08\x12\x04\x19\x1f\x1e\x03\n\x0f\n\x08\x04\0\x02\x06\ - \x08\xee\xfb\x03\x12\x03\x1a\x06:\n\x0f\n\x08\x04\0\x02\x06\x08\xeb\xfb\ - \x03\x12\x03\x1b\x06G\n\x0f\n\x08\x04\0\x02\x06\x08\xe9\xfb\x03\x12\x03\ - \x1c\x06$\n\x0f\n\x08\x04\0\x02\x06\x08\xed\xfb\x03\x12\x03\x1d\x06.\n\ - \x0b\n\x04\x04\0\x02\x07\x12\x03\x1f\x02\x20\n\x0c\n\x05\x04\0\x02\x07\ - \x06\x12\x03\x1f\x02\x10\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x03\x1f\x11\ - \x1b\n\x0c\n\x05\x04\0\x02\x07\x03\x12\x03\x1f\x1e\x1fb\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(3); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::trade_pair_id::file_descriptor().clone()); - deps.push(super::tx::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(LimitOrderTrancheUser::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index 2c4b54f8..cc84d8b2 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -1,18 +1,2 @@ // @generated - -pub mod bank; -pub mod cosmos; -pub mod deposit_record; -pub mod gogo; -pub mod limit_order_expiration; -pub mod limit_order_tranche; -pub mod limit_order_tranche_user; -pub mod pair_id; -pub mod params; -pub mod pool; -pub mod pool_metadata; -pub mod pool_reserves; -pub mod tick_liquidity; -pub mod trade_pair_id; pub mod transfer; -pub mod tx; diff --git a/packages/neutron-sdk/src/proto_types/pair_id.rs b/packages/neutron-sdk/src/proto_types/pair_id.rs deleted file mode 100644 index 732f2745..00000000 --- a/packages/neutron-sdk/src/proto_types/pair_id.rs +++ /dev/null @@ -1,210 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/pair_id.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.PairID) -pub struct PairID { - // message fields - // @@protoc_insertion_point(field:neutron.dex.PairID.token0) - pub token0: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.PairID.token1) - pub token1: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.PairID.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a PairID { - fn default() -> &'a PairID { - ::default_instance() - } -} - -impl PairID { - pub fn new() -> PairID { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token0", - |m: &PairID| { &m.token0 }, - |m: &mut PairID| { &mut m.token0 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token1", - |m: &PairID| { &m.token1 }, - |m: &mut PairID| { &mut m.token1 }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "PairID", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for PairID { - const NAME: &'static str = "PairID"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.token0 = is.read_string()?; - }, - 18 => { - self.token1 = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.token0.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.token0); - } - if !self.token1.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.token1); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.token0.is_empty() { - os.write_string(1, &self.token0)?; - } - if !self.token1.is_empty() { - os.write_string(2, &self.token1)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> PairID { - PairID::new() - } - - fn clear(&mut self) { - self.token0.clear(); - self.token1.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static PairID { - static instance: PairID = PairID { - token0: ::std::string::String::new(), - token1: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for PairID { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("PairID").unwrap()).clone() - } -} - -impl ::std::fmt::Display for PairID { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PairID { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x19neutron/dex/pair_id.proto\x12\x0bneutron.dex\"8\n\x06PairID\x12\ - \x16\n\x06token0\x18\x01\x20\x01(\tR\x06token0\x12\x16\n\x06token1\x18\ - \x02\x20\x01(\tR\x06token1B,Z*github.com/neutron-org/neutron/x/dex/types\ - J\xb7\x01\n\x06\x12\x04\0\0\x08\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\ - \x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0A\n\t\n\ - \x02\x08\x0b\x12\x03\x03\0A\n\n\n\x02\x04\0\x12\x04\x05\0\x08\x01\n\n\n\ - \x03\x04\0\x01\x12\x03\x05\x08\x0e\n\x0b\n\x04\x04\0\x02\0\x12\x03\x06\ - \x02\x14\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x06\x02\x08\n\x0c\n\x05\x04\ - \0\x02\0\x01\x12\x03\x06\t\x0f\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x06\ - \x12\x13\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x07\x02\x14\n\x0c\n\x05\x04\0\ - \x02\x01\x05\x12\x03\x07\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\ - \x07\t\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x07\x12\x13b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(0); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(PairID::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/params.rs b/packages/neutron-sdk/src/proto_types/params.rs deleted file mode 100644 index 4ca58775..00000000 --- a/packages/neutron-sdk/src/proto_types/params.rs +++ /dev/null @@ -1,198 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/params.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -/// Params defines the parameters for the module. -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.Params) -pub struct Params { - // message fields - // @@protoc_insertion_point(field:neutron.dex.Params.fee_tiers) - pub fee_tiers: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.Params.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Params { - fn default() -> &'a Params { - ::default_instance() - } -} - -impl Params { - pub fn new() -> Params { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "fee_tiers", - |m: &Params| { &m.fee_tiers }, - |m: &mut Params| { &mut m.fee_tiers }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Params", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Params { - const NAME: &'static str = "Params"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - is.read_repeated_packed_uint64_into(&mut self.fee_tiers)?; - }, - 8 => { - self.fee_tiers.push(is.read_uint64()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - for value in &self.fee_tiers { - my_size += ::protobuf::rt::uint64_size(1, *value); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.fee_tiers { - os.write_uint64(1, *v)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Params { - Params::new() - } - - fn clear(&mut self) { - self.fee_tiers.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Params { - static instance: Params = Params { - fee_tiers: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Params { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Params").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Params { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Params { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x18neutron/dex/params.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.\ - proto\"+\n\x06Params\x12\x1b\n\tfee_tiers\x18\x01\x20\x03(\x04R\x08feeTi\ - ers:\x04\x98\xa0\x1f\0B,Z*github.com/neutron-org/neutron/x/dex/typesJ\ - \xe5\x01\n\x06\x12\x04\0\0\x0b\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\ - \n\x01\x02\x12\x03\x01\0\x14\n\t\n\x02\x03\0\x12\x03\x03\0\x1e\n\x08\n\ - \x01\x08\x12\x03\x05\0A\n\t\n\x02\x08\x0b\x12\x03\x05\0A\n;\n\x02\x04\0\ - \x12\x04\x08\0\x0b\x01\x1a/\x20Params\x20defines\x20the\x20parameters\ - \x20for\x20the\x20module.\n\n\n\n\x03\x04\0\x01\x12\x03\x08\x08\x0e\n\n\ - \n\x03\x04\0\x07\x12\x03\t\x02.\n\r\n\x06\x04\0\x07\x83\xf4\x03\x12\x03\ - \t\x02.\n\x0b\n\x04\x04\0\x02\0\x12\x03\n\x02\x20\n\x0c\n\x05\x04\0\x02\ - \0\x04\x12\x03\n\x02\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\n\x0b\x11\n\ - \x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x12\x1b\n\x0c\n\x05\x04\0\x02\0\x03\ - \x12\x03\n\x1e\x1fb\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(1); - deps.push(super::gogo::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(Params::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/pool.rs b/packages/neutron-sdk/src/proto_types/pool.rs deleted file mode 100644 index d095f1dc..00000000 --- a/packages/neutron-sdk/src/proto_types/pool.rs +++ /dev/null @@ -1,241 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/pool.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.Pool) -pub struct Pool { - // message fields - // @@protoc_insertion_point(field:neutron.dex.Pool.id) - pub id: u64, - // @@protoc_insertion_point(field:neutron.dex.Pool.lower_tick0) - pub lower_tick0: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.Pool.upper_tick1) - pub upper_tick1: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.Pool.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a Pool { - fn default() -> &'a Pool { - ::default_instance() - } -} - -impl Pool { - pub fn new() -> Pool { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "id", - |m: &Pool| { &m.id }, - |m: &mut Pool| { &mut m.id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pool_reserves::PoolReserves>( - "lower_tick0", - |m: &Pool| { &m.lower_tick0 }, - |m: &mut Pool| { &mut m.lower_tick0 }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pool_reserves::PoolReserves>( - "upper_tick1", - |m: &Pool| { &m.upper_tick1 }, - |m: &mut Pool| { &mut m.upper_tick1 }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "Pool", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for Pool { - const NAME: &'static str = "Pool"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.id = is.read_uint64()?; - }, - 18 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.lower_tick0)?; - }, - 26 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.upper_tick1)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.id != 0 { - my_size += ::protobuf::rt::uint64_size(1, self.id); - } - if let Some(v) = self.lower_tick0.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.upper_tick1.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.id != 0 { - os.write_uint64(1, self.id)?; - } - if let Some(v) = self.lower_tick0.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - } - if let Some(v) = self.upper_tick1.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> Pool { - Pool::new() - } - - fn clear(&mut self) { - self.id = 0; - self.lower_tick0.clear(); - self.upper_tick1.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static Pool { - static instance: Pool = Pool { - id: 0, - lower_tick0: ::protobuf::MessageField::none(), - upper_tick1: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for Pool { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("Pool").unwrap()).clone() - } -} - -impl ::std::fmt::Display for Pool { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Pool { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x16neutron/dex/pool.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.pr\ - oto\x1a\x1fneutron/dex/pool_reserves.proto\"\x8e\x01\n\x04Pool\x12\x0e\n\ - \x02id\x18\x01\x20\x01(\x04R\x02id\x12:\n\x0blower_tick0\x18\x02\x20\x01\ - (\x0b2\x19.neutron.dex.PoolReservesR\nlowerTick0\x12:\n\x0bupper_tick1\ - \x18\x03\x20\x01(\x0b2\x19.neutron.dex.PoolReservesR\nupperTick1B,Z*gith\ - ub.com/neutron-org/neutron/x/dex/typesJ\x8a\x03\n\x06\x12\x04\0\0\r\x01\ - \n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\ - \n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\ - \0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\x8f\x01\n\x02\ - \x04\0\x12\x04\t\0\r\x012\x82\x01\x20NOTE:\x20This\x20struct\x20is\x20ne\ - ver\x20actually\x20stored\x20in\x20the\x20KV\x20store.\x20It\x20is\x20me\ - rely\x20a\x20convenience\x20wrapper\x20for\x20holding\x20both\x20sides\ - \x20of\x20a\x20pool.\n\n\n\n\x03\x04\0\x01\x12\x03\t\x08\x0c\n\x0b\n\x04\ - \x04\0\x02\0\x12\x03\n\x04\x12\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\n\x04\ - \n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\n\x0b\r\n\x0c\n\x05\x04\0\x02\0\ - \x03\x12\x03\n\x10\x11\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0b\x04!\n\x0c\ - \n\x05\x04\0\x02\x01\x06\x12\x03\x0b\x04\x10\n\x0c\n\x05\x04\0\x02\x01\ - \x01\x12\x03\x0b\x11\x1c\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0b\x1f\ - \x20\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x0c\x04!\n\x0c\n\x05\x04\0\x02\ - \x02\x06\x12\x03\x0c\x04\x10\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x0c\ - \x11\x1c\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x0c\x1f\x20b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::pool_reserves::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(Pool::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/pool_metadata.rs b/packages/neutron-sdk/src/proto_types/pool_metadata.rs deleted file mode 100644 index d56fccf0..00000000 --- a/packages/neutron-sdk/src/proto_types/pool_metadata.rs +++ /dev/null @@ -1,256 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/pool_metadata.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.PoolMetadata) -pub struct PoolMetadata { - // message fields - // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.id) - pub id: u64, - // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.tick) - pub tick: i64, - // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.fee) - pub fee: u64, - // @@protoc_insertion_point(field:neutron.dex.PoolMetadata.pair_id) - pub pair_id: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.PoolMetadata.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a PoolMetadata { - fn default() -> &'a PoolMetadata { - ::default_instance() - } -} - -impl PoolMetadata { - pub fn new() -> PoolMetadata { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(4); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "id", - |m: &PoolMetadata| { &m.id }, - |m: &mut PoolMetadata| { &mut m.id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tick", - |m: &PoolMetadata| { &m.tick }, - |m: &mut PoolMetadata| { &mut m.tick }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "fee", - |m: &PoolMetadata| { &m.fee }, - |m: &mut PoolMetadata| { &mut m.fee }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::pair_id::PairID>( - "pair_id", - |m: &PoolMetadata| { &m.pair_id }, - |m: &mut PoolMetadata| { &mut m.pair_id }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "PoolMetadata", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for PoolMetadata { - const NAME: &'static str = "PoolMetadata"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.id = is.read_uint64()?; - }, - 16 => { - self.tick = is.read_int64()?; - }, - 24 => { - self.fee = is.read_uint64()?; - }, - 34 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.pair_id)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.id != 0 { - my_size += ::protobuf::rt::uint64_size(1, self.id); - } - if self.tick != 0 { - my_size += ::protobuf::rt::int64_size(2, self.tick); - } - if self.fee != 0 { - my_size += ::protobuf::rt::uint64_size(3, self.fee); - } - if let Some(v) = self.pair_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.id != 0 { - os.write_uint64(1, self.id)?; - } - if self.tick != 0 { - os.write_int64(2, self.tick)?; - } - if self.fee != 0 { - os.write_uint64(3, self.fee)?; - } - if let Some(v) = self.pair_id.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> PoolMetadata { - PoolMetadata::new() - } - - fn clear(&mut self) { - self.id = 0; - self.tick = 0; - self.fee = 0; - self.pair_id.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static PoolMetadata { - static instance: PoolMetadata = PoolMetadata { - id: 0, - tick: 0, - fee: 0, - pair_id: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for PoolMetadata { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolMetadata").unwrap()).clone() - } -} - -impl ::std::fmt::Display for PoolMetadata { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PoolMetadata { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1fneutron/dex/pool_metadata.proto\x12\x0bneutron.dex\x1a\x19neutron/\ - dex/pair_id.proto\"r\n\x0cPoolMetadata\x12\x0e\n\x02id\x18\x01\x20\x01(\ - \x04R\x02id\x12\x12\n\x04tick\x18\x02\x20\x01(\x03R\x04tick\x12\x10\n\ - \x03fee\x18\x03\x20\x01(\x04R\x03fee\x12,\n\x07pair_id\x18\x04\x20\x01(\ - \x0b2\x13.neutron.dex.PairIDR\x06pairIdB,Z*github.com/neutron-org/neutro\ - n/x/dex/typesJ\xb0\x02\n\x06\x12\x04\0\0\x0c\x01\n\x08\n\x01\x0c\x12\x03\ - \0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\x03\x03\0\ - A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\x03\x05\0#\n\n\n\ - \x02\x04\0\x12\x04\x07\0\x0c\x01\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x14\ - \n\x0b\n\x04\x04\0\x02\0\x12\x03\x08\x02\x10\n\x0c\n\x05\x04\0\x02\0\x05\ - \x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\t\x0b\n\x0c\ - \n\x05\x04\0\x02\0\x03\x12\x03\x08\x0e\x0f\n\x0b\n\x04\x04\0\x02\x01\x12\ - \x03\t\x02\x11\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\t\x02\x07\n\x0c\n\ - \x05\x04\0\x02\x01\x01\x12\x03\t\x08\x0c\n\x0c\n\x05\x04\0\x02\x01\x03\ - \x12\x03\t\x0f\x10\n\x0b\n\x04\x04\0\x02\x02\x12\x03\n\x02\x11\n\x0c\n\ - \x05\x04\0\x02\x02\x05\x12\x03\n\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\ - \x12\x03\n\t\x0c\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\n\x0f\x10\n\x0b\n\ - \x04\x04\0\x02\x03\x12\x03\x0b\x02\x15\n\x0c\n\x05\x04\0\x02\x03\x06\x12\ - \x03\x0b\x02\x08\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x0b\t\x10\n\x0c\n\ - \x05\x04\0\x02\x03\x03\x12\x03\x0b\x13\x14b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(1); - deps.push(super::pair_id::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(PoolMetadata::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/pool_reserves.rs b/packages/neutron-sdk/src/proto_types/pool_reserves.rs deleted file mode 100644 index a3b227f5..00000000 --- a/packages/neutron-sdk/src/proto_types/pool_reserves.rs +++ /dev/null @@ -1,452 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/pool_reserves.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.PoolReservesKey) -pub struct PoolReservesKey { - // message fields - // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.trade_pair_id) - pub trade_pair_id: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.tick_index_taker_to_maker) - pub tick_index_taker_to_maker: i64, - // @@protoc_insertion_point(field:neutron.dex.PoolReservesKey.fee) - pub fee: u64, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.PoolReservesKey.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a PoolReservesKey { - fn default() -> &'a PoolReservesKey { - ::default_instance() - } -} - -impl PoolReservesKey { - pub fn new() -> PoolReservesKey { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::trade_pair_id::TradePairID>( - "trade_pair_id", - |m: &PoolReservesKey| { &m.trade_pair_id }, - |m: &mut PoolReservesKey| { &mut m.trade_pair_id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tick_index_taker_to_maker", - |m: &PoolReservesKey| { &m.tick_index_taker_to_maker }, - |m: &mut PoolReservesKey| { &mut m.tick_index_taker_to_maker }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "fee", - |m: &PoolReservesKey| { &m.fee }, - |m: &mut PoolReservesKey| { &mut m.fee }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "PoolReservesKey", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for PoolReservesKey { - const NAME: &'static str = "PoolReservesKey"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.trade_pair_id)?; - }, - 16 => { - self.tick_index_taker_to_maker = is.read_int64()?; - }, - 24 => { - self.fee = is.read_uint64()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.trade_pair_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if self.tick_index_taker_to_maker != 0 { - my_size += ::protobuf::rt::int64_size(2, self.tick_index_taker_to_maker); - } - if self.fee != 0 { - my_size += ::protobuf::rt::uint64_size(3, self.fee); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.trade_pair_id.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if self.tick_index_taker_to_maker != 0 { - os.write_int64(2, self.tick_index_taker_to_maker)?; - } - if self.fee != 0 { - os.write_uint64(3, self.fee)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> PoolReservesKey { - PoolReservesKey::new() - } - - fn clear(&mut self) { - self.trade_pair_id.clear(); - self.tick_index_taker_to_maker = 0; - self.fee = 0; - self.special_fields.clear(); - } - - fn default_instance() -> &'static PoolReservesKey { - static instance: PoolReservesKey = PoolReservesKey { - trade_pair_id: ::protobuf::MessageField::none(), - tick_index_taker_to_maker: 0, - fee: 0, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for PoolReservesKey { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolReservesKey").unwrap()).clone() - } -} - -impl ::std::fmt::Display for PoolReservesKey { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PoolReservesKey { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.PoolReserves) -pub struct PoolReserves { - // message fields - // @@protoc_insertion_point(field:neutron.dex.PoolReserves.key) - pub key: ::protobuf::MessageField, - // @@protoc_insertion_point(field:neutron.dex.PoolReserves.reserves_maker_denom) - pub reserves_maker_denom: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.PoolReserves.price_taker_to_maker) - pub price_taker_to_maker: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.PoolReserves.price_opposite_taker_to_maker) - pub price_opposite_taker_to_maker: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.PoolReserves.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a PoolReserves { - fn default() -> &'a PoolReserves { - ::default_instance() - } -} - -impl PoolReserves { - pub fn new() -> PoolReserves { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(4); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, PoolReservesKey>( - "key", - |m: &PoolReserves| { &m.key }, - |m: &mut PoolReserves| { &mut m.key }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "reserves_maker_denom", - |m: &PoolReserves| { &m.reserves_maker_denom }, - |m: &mut PoolReserves| { &mut m.reserves_maker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "price_taker_to_maker", - |m: &PoolReserves| { &m.price_taker_to_maker }, - |m: &mut PoolReserves| { &mut m.price_taker_to_maker }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "price_opposite_taker_to_maker", - |m: &PoolReserves| { &m.price_opposite_taker_to_maker }, - |m: &mut PoolReserves| { &mut m.price_opposite_taker_to_maker }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "PoolReserves", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for PoolReserves { - const NAME: &'static str = "PoolReserves"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.key)?; - }, - 18 => { - self.reserves_maker_denom = is.read_string()?; - }, - 26 => { - self.price_taker_to_maker = is.read_string()?; - }, - 34 => { - self.price_opposite_taker_to_maker = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.key.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.reserves_maker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.reserves_maker_denom); - } - if !self.price_taker_to_maker.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.price_taker_to_maker); - } - if !self.price_opposite_taker_to_maker.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.price_opposite_taker_to_maker); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.key.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - if !self.reserves_maker_denom.is_empty() { - os.write_string(2, &self.reserves_maker_denom)?; - } - if !self.price_taker_to_maker.is_empty() { - os.write_string(3, &self.price_taker_to_maker)?; - } - if !self.price_opposite_taker_to_maker.is_empty() { - os.write_string(4, &self.price_opposite_taker_to_maker)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> PoolReserves { - PoolReserves::new() - } - - fn clear(&mut self) { - self.key.clear(); - self.reserves_maker_denom.clear(); - self.price_taker_to_maker.clear(); - self.price_opposite_taker_to_maker.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static PoolReserves { - static instance: PoolReserves = PoolReserves { - key: ::protobuf::MessageField::none(), - reserves_maker_denom: ::std::string::String::new(), - price_taker_to_maker: ::std::string::String::new(), - price_opposite_taker_to_maker: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for PoolReserves { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("PoolReserves").unwrap()).clone() - } -} - -impl ::std::fmt::Display for PoolReserves { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PoolReserves { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1fneutron/dex/pool_reserves.proto\x12\x0bneutron.dex\x1a\x14gogoprot\ - o/gogo.proto\x1a\x1fneutron/dex/trade_pair_id.proto\"\x9b\x01\n\x0fPoolR\ - eservesKey\x12<\n\rtrade_pair_id\x18\x01\x20\x01(\x0b2\x18.neutron.dex.T\ - radePairIDR\x0btradePairId\x128\n\x19tick_index_taker_to_maker\x18\x02\ - \x20\x01(\x03R\x15tickIndexTakerToMaker\x12\x10\n\x03fee\x18\x03\x20\x01\ - (\x04R\x03fee\"\xc4\x04\n\x0cPoolReserves\x12.\n\x03key\x18\x01\x20\x01(\ - \x0b2\x1c.neutron.dex.PoolReservesKeyR\x03key\x12\x97\x01\n\x14reserves_\ - maker_denom\x18\x02\x20\x01(\tR\x12reservesMakerDenomBe\xf2\xde\x1f\x1by\ - aml:\"reserves_maker_denom\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/ty\ - pes.Int\xea\xde\x1f\x14reserves_maker_denom\xc8\xde\x1f\0\x12\xa1\x01\n\ - \x14price_taker_to_maker\x18\x03\x20\x01(\tR\x11priceTakerToMakerBp\xf2\ - \xde\x1f\x1byaml:\"price_taker_to_maker\"\xda\xde\x1f1github.com/neutron\ - -org/neutron/utils/math.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x14price_taker\ - _to_maker\x12\xc5\x01\n\x1dprice_opposite_taker_to_maker\x18\x04\x20\x01\ - (\tR\x19priceOppositeTakerToMakerB\x82\x01\xf2\xde\x1f$yaml:\"price_oppo\ - site_taker_to_maker\"\xda\xde\x1f1github.com/neutron-org/neutron/utils/m\ - ath.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x1dprice_opposite_taker_to_makerB,\ - Z*github.com/neutron-org/neutron/x/dex/typesJ\xf4\x05\n\x06\x12\x04\0\0!\ - \x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\ - \x08\n\x01\x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\ - \x03\0\x12\x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0)\n\n\n\x02\x04\ - \0\x12\x04\x07\0\x0b\x01\n\n\n\x03\x04\0\x01\x12\x03\x07\x08\x17\n\x0b\n\ - \x04\x04\0\x02\0\x12\x03\x08\x08&\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\ - \x08\x08\x13\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\x14!\n\x0c\n\x05\ - \x04\0\x02\0\x03\x12\x03\x08$%\n\x0b\n\x04\x04\0\x02\x01\x12\x03\t\x08,\ - \n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\t\x08\r\n\x0c\n\x05\x04\0\x02\x01\ - \x01\x12\x03\t\x0e'\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\t*+\n\x0b\n\ - \x04\x04\0\x02\x02\x12\x03\n\x08\x17\n\x0c\n\x05\x04\0\x02\x02\x05\x12\ - \x03\n\x08\x0e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\n\x0f\x12\n\x0c\n\ - \x05\x04\0\x02\x02\x03\x12\x03\n\x15\x16\n\n\n\x02\x04\x01\x12\x04\r\0!\ - \x01\n\n\n\x03\x04\x01\x01\x12\x03\r\x08\x14\n\x0b\n\x04\x04\x01\x02\0\ - \x12\x03\x0e\x02\x1a\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0e\x02\x11\n\ - \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x0e\x12\x15\n\x0c\n\x05\x04\x01\x02\ - \0\x03\x12\x03\x0e\x18\x19\n\x0c\n\x04\x04\x01\x02\x01\x12\x04\x0f\x02\ - \x14\x13\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x0f\x02\x08\n\x0c\n\x05\ - \x04\x01\x02\x01\x01\x12\x03\x0f\t\x1d\n\x0c\n\x05\x04\x01\x02\x01\x03\ - \x12\x03\x0f\x20!\n\r\n\x05\x04\x01\x02\x01\x08\x12\x04\x0f\"\x14\x12\n\ - \x0f\n\x08\x04\x01\x02\x01\x08\xee\xfb\x03\x12\x03\x10\x11I\n\x0f\n\x08\ - \x04\x01\x02\x01\x08\xeb\xfb\x03\x12\x03\x11\x11R\n\x0f\n\x08\x04\x01\ - \x02\x01\x08\xed\xfb\x03\x12\x03\x12\x11=\n\x0f\n\x08\x04\x01\x02\x01\ - \x08\xe9\xfb\x03\x12\x03\x13\x11/\n\x0c\n\x04\x04\x01\x02\x02\x12\x04\ - \x15\x02\x1a\x12\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x15\x02\x08\n\ - \x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x15\t\x1d\n\x0c\n\x05\x04\x01\x02\ - \x02\x03\x12\x03\x15\x20!\n\r\n\x05\x04\x01\x02\x02\x08\x12\x04\x15\"\ - \x1a\x11\n\x0f\n\x08\x04\x01\x02\x02\x08\xee\xfb\x03\x12\x03\x16\x10H\n\ - \x0f\n\x08\x04\x01\x02\x02\x08\xeb\xfb\x03\x12\x03\x17\x10\\\n\x0f\n\x08\ - \x04\x01\x02\x02\x08\xe9\xfb\x03\x12\x03\x18\x10.\n\x0f\n\x08\x04\x01\ - \x02\x02\x08\xed\xfb\x03\x12\x03\x19\x10<\n\x0c\n\x04\x04\x01\x02\x03\ - \x12\x04\x1b\x02\x20\x12\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x1b\x02\ - \x08\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x1b\t&\n\x0c\n\x05\x04\x01\ - \x02\x03\x03\x12\x03\x1b)*\n\r\n\x05\x04\x01\x02\x03\x08\x12\x04\x1b+\ - \x20\x11\n\x0f\n\x08\x04\x01\x02\x03\x08\xee\xfb\x03\x12\x03\x1c\x10Q\n\ - \x0f\n\x08\x04\x01\x02\x03\x08\xeb\xfb\x03\x12\x03\x1d\x10\\\n\x0f\n\x08\ - \x04\x01\x02\x03\x08\xe9\xfb\x03\x12\x03\x1e\x10.\n\x0f\n\x08\x04\x01\ - \x02\x03\x08\xed\xfb\x03\x12\x03\x1f\x10Eb\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(2); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::trade_pair_id::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(2); - messages.push(PoolReservesKey::generated_message_descriptor_data()); - messages.push(PoolReserves::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/tick_liquidity.rs b/packages/neutron-sdk/src/proto_types/tick_liquidity.rs deleted file mode 100644 index 00c98adf..00000000 --- a/packages/neutron-sdk/src/proto_types/tick_liquidity.rs +++ /dev/null @@ -1,358 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/tick_liquidity.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.TickLiquidity) -pub struct TickLiquidity { - // message oneof groups - pub liquidity: ::std::option::Option, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.TickLiquidity.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a TickLiquidity { - fn default() -> &'a TickLiquidity { - ::default_instance() - } -} - -impl TickLiquidity { - pub fn new() -> TickLiquidity { - ::std::default::Default::default() - } - - // .neutron.dex.PoolReserves pool_reserves = 1; - - pub fn pool_reserves(&self) -> &super::pool_reserves::PoolReserves { - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(ref v)) => v, - _ => ::default_instance(), - } - } - - pub fn clear_pool_reserves(&mut self) { - self.liquidity = ::std::option::Option::None; - } - - pub fn has_pool_reserves(&self) -> bool { - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_pool_reserves(&mut self, v: super::pool_reserves::PoolReserves) { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(v)) - } - - // Mutable pointer to the field. - pub fn mut_pool_reserves(&mut self) -> &mut super::pool_reserves::PoolReserves { - if let ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(_)) = self.liquidity { - } else { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(super::pool_reserves::PoolReserves::new())); - } - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_pool_reserves(&mut self) -> super::pool_reserves::PoolReserves { - if self.has_pool_reserves() { - match self.liquidity.take() { - ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(v)) => v, - _ => panic!(), - } - } else { - super::pool_reserves::PoolReserves::new() - } - } - - // .neutron.dex.LimitOrderTranche limit_order_tranche = 2; - - pub fn limit_order_tranche(&self) -> &super::limit_order_tranche::LimitOrderTranche { - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(ref v)) => v, - _ => ::default_instance(), - } - } - - pub fn clear_limit_order_tranche(&mut self) { - self.liquidity = ::std::option::Option::None; - } - - pub fn has_limit_order_tranche(&self) -> bool { - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_limit_order_tranche(&mut self, v: super::limit_order_tranche::LimitOrderTranche) { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(v)) - } - - // Mutable pointer to the field. - pub fn mut_limit_order_tranche(&mut self) -> &mut super::limit_order_tranche::LimitOrderTranche { - if let ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(_)) = self.liquidity { - } else { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(super::limit_order_tranche::LimitOrderTranche::new())); - } - match self.liquidity { - ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_limit_order_tranche(&mut self) -> super::limit_order_tranche::LimitOrderTranche { - if self.has_limit_order_tranche() { - match self.liquidity.take() { - ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(v)) => v, - _ => panic!(), - } - } else { - super::limit_order_tranche::LimitOrderTranche::new() - } - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(1); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::pool_reserves::PoolReserves>( - "pool_reserves", - TickLiquidity::has_pool_reserves, - TickLiquidity::pool_reserves, - TickLiquidity::mut_pool_reserves, - TickLiquidity::set_pool_reserves, - )); - fields.push(::protobuf::reflect::rt::v2::make_oneof_message_has_get_mut_set_accessor::<_, super::limit_order_tranche::LimitOrderTranche>( - "limit_order_tranche", - TickLiquidity::has_limit_order_tranche, - TickLiquidity::limit_order_tranche, - TickLiquidity::mut_limit_order_tranche, - TickLiquidity::set_limit_order_tranche, - )); - oneofs.push(tick_liquidity::Liquidity::generated_oneof_descriptor_data()); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "TickLiquidity", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for TickLiquidity { - const NAME: &'static str = "TickLiquidity"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::PoolReserves(is.read_message()?)); - }, - 18 => { - self.liquidity = ::std::option::Option::Some(tick_liquidity::Liquidity::LimitOrderTranche(is.read_message()?)); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.liquidity { - match v { - &tick_liquidity::Liquidity::PoolReserves(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }, - &tick_liquidity::Liquidity::LimitOrderTranche(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let ::std::option::Option::Some(ref v) = self.liquidity { - match v { - &tick_liquidity::Liquidity::PoolReserves(ref v) => { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - }, - &tick_liquidity::Liquidity::LimitOrderTranche(ref v) => { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - }, - }; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> TickLiquidity { - TickLiquidity::new() - } - - fn clear(&mut self) { - self.liquidity = ::std::option::Option::None; - self.liquidity = ::std::option::Option::None; - self.special_fields.clear(); - } - - fn default_instance() -> &'static TickLiquidity { - static instance: TickLiquidity = TickLiquidity { - liquidity: ::std::option::Option::None, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for TickLiquidity { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("TickLiquidity").unwrap()).clone() - } -} - -impl ::std::fmt::Display for TickLiquidity { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TickLiquidity { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// Nested message and enums of message `TickLiquidity` -pub mod tick_liquidity { - - #[derive(Clone,PartialEq,Debug)] - #[non_exhaustive] - // @@protoc_insertion_point(oneof:neutron.dex.TickLiquidity.liquidity) - pub enum Liquidity { - // @@protoc_insertion_point(oneof_field:neutron.dex.TickLiquidity.pool_reserves) - PoolReserves(super::super::pool_reserves::PoolReserves), - // @@protoc_insertion_point(oneof_field:neutron.dex.TickLiquidity.limit_order_tranche) - LimitOrderTranche(super::super::limit_order_tranche::LimitOrderTranche), - } - - impl ::protobuf::Oneof for Liquidity { - } - - impl ::protobuf::OneofFull for Liquidity { - fn descriptor() -> ::protobuf::reflect::OneofDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::OneofDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| ::descriptor().oneof_by_name("liquidity").unwrap()).clone() - } - } - - impl Liquidity { - pub(in super) fn generated_oneof_descriptor_data() -> ::protobuf::reflect::GeneratedOneofDescriptorData { - ::protobuf::reflect::GeneratedOneofDescriptorData::new::("liquidity") - } - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x20neutron/dex/tick_liquidity.proto\x12\x0bneutron.dex\x1a\x14gogopro\ - to/gogo.proto\x1a%neutron/dex/limit_order_tranche.proto\x1a\x1fneutron/d\ - ex/pool_reserves.proto\"\xb0\x01\n\rTickLiquidity\x12@\n\rpool_reserves\ - \x18\x01\x20\x01(\x0b2\x19.neutron.dex.PoolReservesH\0R\x0cpoolReserves\ - \x12P\n\x13limit_order_tranche\x18\x02\x20\x01(\x0b2\x1e.neutron.dex.Lim\ - itOrderTrancheH\0R\x11limitOrderTrancheB\x0b\n\tliquidityB,Z*github.com/\ - neutron-org/neutron/x/dex/typesJ\xf4\x01\n\x06\x12\x04\0\0\x0f\x01\n\x08\ - \n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\ - \x08\x12\x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\t\n\x02\x03\0\x12\ - \x03\x04\0\x1e\n\t\n\x02\x03\x01\x12\x03\x05\0/\n\t\n\x02\x03\x02\x12\ - \x03\x06\0)\n\n\n\x02\x04\0\x12\x04\t\0\x0f\x01\n\n\n\x03\x04\0\x01\x12\ - \x03\t\x08\x15\n\x0c\n\x04\x04\0\x08\0\x12\x04\n\x02\r\x03\n\x0c\n\x05\ - \x04\0\x08\0\x01\x12\x03\n\x08\x11\n\x0b\n\x04\x04\0\x02\0\x12\x03\x0b\ - \x04#\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x0b\x04\x10\n\x0c\n\x05\x04\0\ - \x02\0\x01\x12\x03\x0b\x11\x1e\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x0b!\ - \"\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x0c\x04.\n\x0c\n\x05\x04\0\x02\x01\ - \x06\x12\x03\x0c\x04\x15\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x0c\x16)\ - \n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0c,-b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(3); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::limit_order_tranche::file_descriptor().clone()); - deps.push(super::pool_reserves::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(TickLiquidity::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/trade_pair_id.rs b/packages/neutron-sdk/src/proto_types/trade_pair_id.rs deleted file mode 100644 index efb68b7a..00000000 --- a/packages/neutron-sdk/src/proto_types/trade_pair_id.rs +++ /dev/null @@ -1,211 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/trade_pair_id.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.TradePairID) -pub struct TradePairID { - // message fields - // @@protoc_insertion_point(field:neutron.dex.TradePairID.maker_denom) - pub maker_denom: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.TradePairID.taker_denom) - pub taker_denom: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.TradePairID.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a TradePairID { - fn default() -> &'a TradePairID { - ::default_instance() - } -} - -impl TradePairID { - pub fn new() -> TradePairID { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "maker_denom", - |m: &TradePairID| { &m.maker_denom }, - |m: &mut TradePairID| { &mut m.maker_denom }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "taker_denom", - |m: &TradePairID| { &m.taker_denom }, - |m: &mut TradePairID| { &mut m.taker_denom }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "TradePairID", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for TradePairID { - const NAME: &'static str = "TradePairID"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 18 => { - self.maker_denom = is.read_string()?; - }, - 26 => { - self.taker_denom = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.maker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.maker_denom); - } - if !self.taker_denom.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.taker_denom); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.maker_denom.is_empty() { - os.write_string(2, &self.maker_denom)?; - } - if !self.taker_denom.is_empty() { - os.write_string(3, &self.taker_denom)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> TradePairID { - TradePairID::new() - } - - fn clear(&mut self) { - self.maker_denom.clear(); - self.taker_denom.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static TradePairID { - static instance: TradePairID = TradePairID { - maker_denom: ::std::string::String::new(), - taker_denom: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for TradePairID { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("TradePairID").unwrap()).clone() - } -} - -impl ::std::fmt::Display for TradePairID { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TradePairID { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1fneutron/dex/trade_pair_id.proto\x12\x0bneutron.dex\"O\n\x0bTradePa\ - irID\x12\x1f\n\x0bmaker_denom\x18\x02\x20\x01(\tR\nmakerDenom\x12\x1f\n\ - \x0btaker_denom\x18\x03\x20\x01(\tR\ntakerDenomB,Z*github.com/neutron-or\ - g/neutron/x/dex/typesJ\xb7\x01\n\x06\x12\x04\0\0\x08\x01\n\x08\n\x01\x0c\ - \x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\n\x08\n\x01\x08\x12\ - \x03\x03\0A\n\t\n\x02\x08\x0b\x12\x03\x03\0A\n\n\n\x02\x04\0\x12\x04\x05\ - \0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\x05\x08\x13\n\x0b\n\x04\x04\0\x02\ - \0\x12\x03\x06\x04\x1b\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x06\x04\n\n\ - \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x06\x0b\x16\n\x0c\n\x05\x04\0\x02\0\ - \x03\x12\x03\x06\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x07\x04\x1b\n\ - \x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\0\x02\x01\ - \x01\x12\x03\x07\x0b\x16\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x07\x19\ - \x1ab\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(0); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(TradePairID::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/packages/neutron-sdk/src/proto_types/tx.rs b/packages/neutron-sdk/src/proto_types/tx.rs deleted file mode 100644 index 1c21441d..00000000 --- a/packages/neutron-sdk/src/proto_types/tx.rs +++ /dev/null @@ -1,3002 +0,0 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `neutron/dex/tx.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.DepositOptions) -pub struct DepositOptions { - // message fields - // @@protoc_insertion_point(field:neutron.dex.DepositOptions.disable_autoswap) - pub disable_autoswap: bool, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.DepositOptions.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a DepositOptions { - fn default() -> &'a DepositOptions { - ::default_instance() - } -} - -impl DepositOptions { - pub fn new() -> DepositOptions { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "disable_autoswap", - |m: &DepositOptions| { &m.disable_autoswap }, - |m: &mut DepositOptions| { &mut m.disable_autoswap }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "DepositOptions", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for DepositOptions { - const NAME: &'static str = "DepositOptions"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.disable_autoswap = is.read_bool()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.disable_autoswap != false { - my_size += 1 + 1; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.disable_autoswap != false { - os.write_bool(1, self.disable_autoswap)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> DepositOptions { - DepositOptions::new() - } - - fn clear(&mut self) { - self.disable_autoswap = false; - self.special_fields.clear(); - } - - fn default_instance() -> &'static DepositOptions { - static instance: DepositOptions = DepositOptions { - disable_autoswap: false, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for DepositOptions { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("DepositOptions").unwrap()).clone() - } -} - -impl ::std::fmt::Display for DepositOptions { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DepositOptions { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgDeposit) -pub struct MsgDeposit { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.receiver) - pub receiver: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.token_a) - pub token_a: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.token_b) - pub token_b: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.amounts_a) - pub amounts_a: ::std::vec::Vec<::std::string::String>, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.amounts_b) - pub amounts_b: ::std::vec::Vec<::std::string::String>, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.tick_indexes_a_to_b) - pub tick_indexes_a_to_b: ::std::vec::Vec, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.fees) - pub fees: ::std::vec::Vec, - // @@protoc_insertion_point(field:neutron.dex.MsgDeposit.options) - pub options: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgDeposit.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgDeposit { - fn default() -> &'a MsgDeposit { - ::default_instance() - } -} - -impl MsgDeposit { - pub fn new() -> MsgDeposit { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(9); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgDeposit| { &m.creator }, - |m: &mut MsgDeposit| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "receiver", - |m: &MsgDeposit| { &m.receiver }, - |m: &mut MsgDeposit| { &mut m.receiver }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_a", - |m: &MsgDeposit| { &m.token_a }, - |m: &mut MsgDeposit| { &mut m.token_a }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_b", - |m: &MsgDeposit| { &m.token_b }, - |m: &mut MsgDeposit| { &mut m.token_b }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "amounts_a", - |m: &MsgDeposit| { &m.amounts_a }, - |m: &mut MsgDeposit| { &mut m.amounts_a }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "amounts_b", - |m: &MsgDeposit| { &m.amounts_b }, - |m: &mut MsgDeposit| { &mut m.amounts_b }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "tick_indexes_a_to_b", - |m: &MsgDeposit| { &m.tick_indexes_a_to_b }, - |m: &mut MsgDeposit| { &mut m.tick_indexes_a_to_b }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "fees", - |m: &MsgDeposit| { &m.fees }, - |m: &mut MsgDeposit| { &mut m.fees }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "options", - |m: &MsgDeposit| { &m.options }, - |m: &mut MsgDeposit| { &mut m.options }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgDeposit", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgDeposit { - const NAME: &'static str = "MsgDeposit"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.receiver = is.read_string()?; - }, - 26 => { - self.token_a = is.read_string()?; - }, - 34 => { - self.token_b = is.read_string()?; - }, - 42 => { - self.amounts_a.push(is.read_string()?); - }, - 50 => { - self.amounts_b.push(is.read_string()?); - }, - 58 => { - is.read_repeated_packed_int64_into(&mut self.tick_indexes_a_to_b)?; - }, - 56 => { - self.tick_indexes_a_to_b.push(is.read_int64()?); - }, - 66 => { - is.read_repeated_packed_uint64_into(&mut self.fees)?; - }, - 64 => { - self.fees.push(is.read_uint64()?); - }, - 74 => { - self.options.push(is.read_message()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.receiver.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.receiver); - } - if !self.token_a.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.token_a); - } - if !self.token_b.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.token_b); - } - for value in &self.amounts_a { - my_size += ::protobuf::rt::string_size(5, &value); - }; - for value in &self.amounts_b { - my_size += ::protobuf::rt::string_size(6, &value); - }; - for value in &self.tick_indexes_a_to_b { - my_size += ::protobuf::rt::int64_size(7, *value); - }; - for value in &self.fees { - my_size += ::protobuf::rt::uint64_size(8, *value); - }; - for value in &self.options { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.receiver.is_empty() { - os.write_string(2, &self.receiver)?; - } - if !self.token_a.is_empty() { - os.write_string(3, &self.token_a)?; - } - if !self.token_b.is_empty() { - os.write_string(4, &self.token_b)?; - } - for v in &self.amounts_a { - os.write_string(5, &v)?; - }; - for v in &self.amounts_b { - os.write_string(6, &v)?; - }; - for v in &self.tick_indexes_a_to_b { - os.write_int64(7, *v)?; - }; - for v in &self.fees { - os.write_uint64(8, *v)?; - }; - for v in &self.options { - ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgDeposit { - MsgDeposit::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.receiver.clear(); - self.token_a.clear(); - self.token_b.clear(); - self.amounts_a.clear(); - self.amounts_b.clear(); - self.tick_indexes_a_to_b.clear(); - self.fees.clear(); - self.options.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgDeposit { - static instance: MsgDeposit = MsgDeposit { - creator: ::std::string::String::new(), - receiver: ::std::string::String::new(), - token_a: ::std::string::String::new(), - token_b: ::std::string::String::new(), - amounts_a: ::std::vec::Vec::new(), - amounts_b: ::std::vec::Vec::new(), - tick_indexes_a_to_b: ::std::vec::Vec::new(), - fees: ::std::vec::Vec::new(), - options: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgDeposit { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgDeposit").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgDeposit { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgDeposit { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgDepositResponse) -pub struct MsgDepositResponse { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgDepositResponse.reserve0_deposited) - pub reserve0_deposited: ::std::vec::Vec<::std::string::String>, - // @@protoc_insertion_point(field:neutron.dex.MsgDepositResponse.reserve1_deposited) - pub reserve1_deposited: ::std::vec::Vec<::std::string::String>, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgDepositResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgDepositResponse { - fn default() -> &'a MsgDepositResponse { - ::default_instance() - } -} - -impl MsgDepositResponse { - pub fn new() -> MsgDepositResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "reserve0_deposited", - |m: &MsgDepositResponse| { &m.reserve0_deposited }, - |m: &mut MsgDepositResponse| { &mut m.reserve0_deposited }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "reserve1_deposited", - |m: &MsgDepositResponse| { &m.reserve1_deposited }, - |m: &mut MsgDepositResponse| { &mut m.reserve1_deposited }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgDepositResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgDepositResponse { - const NAME: &'static str = "MsgDepositResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.reserve0_deposited.push(is.read_string()?); - }, - 18 => { - self.reserve1_deposited.push(is.read_string()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - for value in &self.reserve0_deposited { - my_size += ::protobuf::rt::string_size(1, &value); - }; - for value in &self.reserve1_deposited { - my_size += ::protobuf::rt::string_size(2, &value); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.reserve0_deposited { - os.write_string(1, &v)?; - }; - for v in &self.reserve1_deposited { - os.write_string(2, &v)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgDepositResponse { - MsgDepositResponse::new() - } - - fn clear(&mut self) { - self.reserve0_deposited.clear(); - self.reserve1_deposited.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgDepositResponse { - static instance: MsgDepositResponse = MsgDepositResponse { - reserve0_deposited: ::std::vec::Vec::new(), - reserve1_deposited: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgDepositResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgDepositResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgDepositResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgDepositResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawal) -pub struct MsgWithdrawal { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.receiver) - pub receiver: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.token_a) - pub token_a: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.token_b) - pub token_b: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.shares_to_remove) - pub shares_to_remove: ::std::vec::Vec<::std::string::String>, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.tick_indexes_a_to_b) - pub tick_indexes_a_to_b: ::std::vec::Vec, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawal.fees) - pub fees: ::std::vec::Vec, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawal.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgWithdrawal { - fn default() -> &'a MsgWithdrawal { - ::default_instance() - } -} - -impl MsgWithdrawal { - pub fn new() -> MsgWithdrawal { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(7); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgWithdrawal| { &m.creator }, - |m: &mut MsgWithdrawal| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "receiver", - |m: &MsgWithdrawal| { &m.receiver }, - |m: &mut MsgWithdrawal| { &mut m.receiver }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_a", - |m: &MsgWithdrawal| { &m.token_a }, - |m: &mut MsgWithdrawal| { &mut m.token_a }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_b", - |m: &MsgWithdrawal| { &m.token_b }, - |m: &mut MsgWithdrawal| { &mut m.token_b }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "shares_to_remove", - |m: &MsgWithdrawal| { &m.shares_to_remove }, - |m: &mut MsgWithdrawal| { &mut m.shares_to_remove }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "tick_indexes_a_to_b", - |m: &MsgWithdrawal| { &m.tick_indexes_a_to_b }, - |m: &mut MsgWithdrawal| { &mut m.tick_indexes_a_to_b }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "fees", - |m: &MsgWithdrawal| { &m.fees }, - |m: &mut MsgWithdrawal| { &mut m.fees }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgWithdrawal", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgWithdrawal { - const NAME: &'static str = "MsgWithdrawal"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.receiver = is.read_string()?; - }, - 26 => { - self.token_a = is.read_string()?; - }, - 34 => { - self.token_b = is.read_string()?; - }, - 42 => { - self.shares_to_remove.push(is.read_string()?); - }, - 50 => { - is.read_repeated_packed_int64_into(&mut self.tick_indexes_a_to_b)?; - }, - 48 => { - self.tick_indexes_a_to_b.push(is.read_int64()?); - }, - 58 => { - is.read_repeated_packed_uint64_into(&mut self.fees)?; - }, - 56 => { - self.fees.push(is.read_uint64()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.receiver.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.receiver); - } - if !self.token_a.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.token_a); - } - if !self.token_b.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.token_b); - } - for value in &self.shares_to_remove { - my_size += ::protobuf::rt::string_size(5, &value); - }; - for value in &self.tick_indexes_a_to_b { - my_size += ::protobuf::rt::int64_size(6, *value); - }; - for value in &self.fees { - my_size += ::protobuf::rt::uint64_size(7, *value); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.receiver.is_empty() { - os.write_string(2, &self.receiver)?; - } - if !self.token_a.is_empty() { - os.write_string(3, &self.token_a)?; - } - if !self.token_b.is_empty() { - os.write_string(4, &self.token_b)?; - } - for v in &self.shares_to_remove { - os.write_string(5, &v)?; - }; - for v in &self.tick_indexes_a_to_b { - os.write_int64(6, *v)?; - }; - for v in &self.fees { - os.write_uint64(7, *v)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgWithdrawal { - MsgWithdrawal::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.receiver.clear(); - self.token_a.clear(); - self.token_b.clear(); - self.shares_to_remove.clear(); - self.tick_indexes_a_to_b.clear(); - self.fees.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgWithdrawal { - static instance: MsgWithdrawal = MsgWithdrawal { - creator: ::std::string::String::new(), - receiver: ::std::string::String::new(), - token_a: ::std::string::String::new(), - token_b: ::std::string::String::new(), - shares_to_remove: ::std::vec::Vec::new(), - tick_indexes_a_to_b: ::std::vec::Vec::new(), - fees: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgWithdrawal { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawal").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgWithdrawal { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgWithdrawal { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawalResponse) -pub struct MsgWithdrawalResponse { - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawalResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgWithdrawalResponse { - fn default() -> &'a MsgWithdrawalResponse { - ::default_instance() - } -} - -impl MsgWithdrawalResponse { - pub fn new() -> MsgWithdrawalResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(0); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgWithdrawalResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgWithdrawalResponse { - const NAME: &'static str = "MsgWithdrawalResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgWithdrawalResponse { - MsgWithdrawalResponse::new() - } - - fn clear(&mut self) { - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgWithdrawalResponse { - static instance: MsgWithdrawalResponse = MsgWithdrawalResponse { - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgWithdrawalResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawalResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgWithdrawalResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgWithdrawalResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgPlaceLimitOrder) -pub struct MsgPlaceLimitOrder { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.receiver) - pub receiver: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.token_in) - pub token_in: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.token_out) - pub token_out: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.tick_index_in_to_out) - pub tick_index_in_to_out: i64, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.amount_in) - pub amount_in: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.order_type) - pub order_type: ::protobuf::EnumOrUnknown, - /// expirationTime is only valid iff orderType == GOOD_TIL_TIME. - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.expiration_time) - pub expiration_time: ::protobuf::MessageField<::protobuf::well_known_types::timestamp::Timestamp>, - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrder.max_amount_out) - pub max_amount_out: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgPlaceLimitOrder.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgPlaceLimitOrder { - fn default() -> &'a MsgPlaceLimitOrder { - ::default_instance() - } -} - -impl MsgPlaceLimitOrder { - pub fn new() -> MsgPlaceLimitOrder { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(9); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgPlaceLimitOrder| { &m.creator }, - |m: &mut MsgPlaceLimitOrder| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "receiver", - |m: &MsgPlaceLimitOrder| { &m.receiver }, - |m: &mut MsgPlaceLimitOrder| { &mut m.receiver }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_in", - |m: &MsgPlaceLimitOrder| { &m.token_in }, - |m: &mut MsgPlaceLimitOrder| { &mut m.token_in }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "token_out", - |m: &MsgPlaceLimitOrder| { &m.token_out }, - |m: &mut MsgPlaceLimitOrder| { &mut m.token_out }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tick_index_in_to_out", - |m: &MsgPlaceLimitOrder| { &m.tick_index_in_to_out }, - |m: &mut MsgPlaceLimitOrder| { &mut m.tick_index_in_to_out }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "amount_in", - |m: &MsgPlaceLimitOrder| { &m.amount_in }, - |m: &mut MsgPlaceLimitOrder| { &mut m.amount_in }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "order_type", - |m: &MsgPlaceLimitOrder| { &m.order_type }, - |m: &mut MsgPlaceLimitOrder| { &mut m.order_type }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, ::protobuf::well_known_types::timestamp::Timestamp>( - "expiration_time", - |m: &MsgPlaceLimitOrder| { &m.expiration_time }, - |m: &mut MsgPlaceLimitOrder| { &mut m.expiration_time }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "max_amount_out", - |m: &MsgPlaceLimitOrder| { &m.max_amount_out }, - |m: &mut MsgPlaceLimitOrder| { &mut m.max_amount_out }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgPlaceLimitOrder", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgPlaceLimitOrder { - const NAME: &'static str = "MsgPlaceLimitOrder"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.receiver = is.read_string()?; - }, - 26 => { - self.token_in = is.read_string()?; - }, - 34 => { - self.token_out = is.read_string()?; - }, - 40 => { - self.tick_index_in_to_out = is.read_int64()?; - }, - 58 => { - self.amount_in = is.read_string()?; - }, - 64 => { - self.order_type = is.read_enum_or_unknown()?; - }, - 74 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.expiration_time)?; - }, - 82 => { - self.max_amount_out = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.receiver.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.receiver); - } - if !self.token_in.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.token_in); - } - if !self.token_out.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.token_out); - } - if self.tick_index_in_to_out != 0 { - my_size += ::protobuf::rt::int64_size(5, self.tick_index_in_to_out); - } - if !self.amount_in.is_empty() { - my_size += ::protobuf::rt::string_size(7, &self.amount_in); - } - if self.order_type != ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED) { - my_size += ::protobuf::rt::int32_size(8, self.order_type.value()); - } - if let Some(v) = self.expiration_time.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if !self.max_amount_out.is_empty() { - my_size += ::protobuf::rt::string_size(10, &self.max_amount_out); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.receiver.is_empty() { - os.write_string(2, &self.receiver)?; - } - if !self.token_in.is_empty() { - os.write_string(3, &self.token_in)?; - } - if !self.token_out.is_empty() { - os.write_string(4, &self.token_out)?; - } - if self.tick_index_in_to_out != 0 { - os.write_int64(5, self.tick_index_in_to_out)?; - } - if !self.amount_in.is_empty() { - os.write_string(7, &self.amount_in)?; - } - if self.order_type != ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED) { - os.write_enum(8, ::protobuf::EnumOrUnknown::value(&self.order_type))?; - } - if let Some(v) = self.expiration_time.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?; - } - if !self.max_amount_out.is_empty() { - os.write_string(10, &self.max_amount_out)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgPlaceLimitOrder { - MsgPlaceLimitOrder::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.receiver.clear(); - self.token_in.clear(); - self.token_out.clear(); - self.tick_index_in_to_out = 0; - self.amount_in.clear(); - self.order_type = ::protobuf::EnumOrUnknown::new(LimitOrderType::GOOD_TIL_CANCELLED); - self.expiration_time.clear(); - self.max_amount_out.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgPlaceLimitOrder { - static instance: MsgPlaceLimitOrder = MsgPlaceLimitOrder { - creator: ::std::string::String::new(), - receiver: ::std::string::String::new(), - token_in: ::std::string::String::new(), - token_out: ::std::string::String::new(), - tick_index_in_to_out: 0, - amount_in: ::std::string::String::new(), - order_type: ::protobuf::EnumOrUnknown::from_i32(0), - expiration_time: ::protobuf::MessageField::none(), - max_amount_out: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgPlaceLimitOrder { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgPlaceLimitOrder").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgPlaceLimitOrder { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgPlaceLimitOrder { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgPlaceLimitOrderResponse) -pub struct MsgPlaceLimitOrderResponse { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.trancheKey) - pub trancheKey: ::std::string::String, - /// Total amount of coin used for the limit order - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.coin_in) - pub coin_in: ::protobuf::MessageField, - /// Total amount of coin received from the taker portion of the limit order - /// This is the amount of coin immediately available in the users account after executing the - /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future - // @@protoc_insertion_point(field:neutron.dex.MsgPlaceLimitOrderResponse.taker_coin_out) - pub taker_coin_out: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgPlaceLimitOrderResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgPlaceLimitOrderResponse { - fn default() -> &'a MsgPlaceLimitOrderResponse { - ::default_instance() - } -} - -impl MsgPlaceLimitOrderResponse { - pub fn new() -> MsgPlaceLimitOrderResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(3); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "trancheKey", - |m: &MsgPlaceLimitOrderResponse| { &m.trancheKey }, - |m: &mut MsgPlaceLimitOrderResponse| { &mut m.trancheKey }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( - "coin_in", - |m: &MsgPlaceLimitOrderResponse| { &m.coin_in }, - |m: &mut MsgPlaceLimitOrderResponse| { &mut m.coin_in }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( - "taker_coin_out", - |m: &MsgPlaceLimitOrderResponse| { &m.taker_coin_out }, - |m: &mut MsgPlaceLimitOrderResponse| { &mut m.taker_coin_out }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgPlaceLimitOrderResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgPlaceLimitOrderResponse { - const NAME: &'static str = "MsgPlaceLimitOrderResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.trancheKey = is.read_string()?; - }, - 18 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.coin_in)?; - }, - 26 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.taker_coin_out)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.trancheKey.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.trancheKey); - } - if let Some(v) = self.coin_in.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - if let Some(v) = self.taker_coin_out.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.trancheKey.is_empty() { - os.write_string(1, &self.trancheKey)?; - } - if let Some(v) = self.coin_in.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - } - if let Some(v) = self.taker_coin_out.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgPlaceLimitOrderResponse { - MsgPlaceLimitOrderResponse::new() - } - - fn clear(&mut self) { - self.trancheKey.clear(); - self.coin_in.clear(); - self.taker_coin_out.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgPlaceLimitOrderResponse { - static instance: MsgPlaceLimitOrderResponse = MsgPlaceLimitOrderResponse { - trancheKey: ::std::string::String::new(), - coin_in: ::protobuf::MessageField::none(), - taker_coin_out: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgPlaceLimitOrderResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgPlaceLimitOrderResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgPlaceLimitOrderResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgPlaceLimitOrderResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawFilledLimitOrder) -pub struct MsgWithdrawFilledLimitOrder { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawFilledLimitOrder.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgWithdrawFilledLimitOrder.tranche_key) - pub tranche_key: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawFilledLimitOrder.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgWithdrawFilledLimitOrder { - fn default() -> &'a MsgWithdrawFilledLimitOrder { - ::default_instance() - } -} - -impl MsgWithdrawFilledLimitOrder { - pub fn new() -> MsgWithdrawFilledLimitOrder { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgWithdrawFilledLimitOrder| { &m.creator }, - |m: &mut MsgWithdrawFilledLimitOrder| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tranche_key", - |m: &MsgWithdrawFilledLimitOrder| { &m.tranche_key }, - |m: &mut MsgWithdrawFilledLimitOrder| { &mut m.tranche_key }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgWithdrawFilledLimitOrder", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgWithdrawFilledLimitOrder { - const NAME: &'static str = "MsgWithdrawFilledLimitOrder"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.tranche_key = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.tranche_key.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.tranche_key); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.tranche_key.is_empty() { - os.write_string(2, &self.tranche_key)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgWithdrawFilledLimitOrder { - MsgWithdrawFilledLimitOrder::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.tranche_key.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgWithdrawFilledLimitOrder { - static instance: MsgWithdrawFilledLimitOrder = MsgWithdrawFilledLimitOrder { - creator: ::std::string::String::new(), - tranche_key: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgWithdrawFilledLimitOrder { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawFilledLimitOrder").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgWithdrawFilledLimitOrder { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgWithdrawFilledLimitOrder { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgWithdrawFilledLimitOrderResponse) -pub struct MsgWithdrawFilledLimitOrderResponse { - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgWithdrawFilledLimitOrderResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgWithdrawFilledLimitOrderResponse { - fn default() -> &'a MsgWithdrawFilledLimitOrderResponse { - ::default_instance() - } -} - -impl MsgWithdrawFilledLimitOrderResponse { - pub fn new() -> MsgWithdrawFilledLimitOrderResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(0); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgWithdrawFilledLimitOrderResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgWithdrawFilledLimitOrderResponse { - const NAME: &'static str = "MsgWithdrawFilledLimitOrderResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgWithdrawFilledLimitOrderResponse { - MsgWithdrawFilledLimitOrderResponse::new() - } - - fn clear(&mut self) { - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgWithdrawFilledLimitOrderResponse { - static instance: MsgWithdrawFilledLimitOrderResponse = MsgWithdrawFilledLimitOrderResponse { - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgWithdrawFilledLimitOrderResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgWithdrawFilledLimitOrderResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgWithdrawFilledLimitOrderResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgWithdrawFilledLimitOrderResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgCancelLimitOrder) -pub struct MsgCancelLimitOrder { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgCancelLimitOrder.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgCancelLimitOrder.tranche_key) - pub tranche_key: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgCancelLimitOrder.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgCancelLimitOrder { - fn default() -> &'a MsgCancelLimitOrder { - ::default_instance() - } -} - -impl MsgCancelLimitOrder { - pub fn new() -> MsgCancelLimitOrder { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgCancelLimitOrder| { &m.creator }, - |m: &mut MsgCancelLimitOrder| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "tranche_key", - |m: &MsgCancelLimitOrder| { &m.tranche_key }, - |m: &mut MsgCancelLimitOrder| { &mut m.tranche_key }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgCancelLimitOrder", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgCancelLimitOrder { - const NAME: &'static str = "MsgCancelLimitOrder"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.tranche_key = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.tranche_key.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.tranche_key); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.tranche_key.is_empty() { - os.write_string(2, &self.tranche_key)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgCancelLimitOrder { - MsgCancelLimitOrder::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.tranche_key.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgCancelLimitOrder { - static instance: MsgCancelLimitOrder = MsgCancelLimitOrder { - creator: ::std::string::String::new(), - tranche_key: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgCancelLimitOrder { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgCancelLimitOrder").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgCancelLimitOrder { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgCancelLimitOrder { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgCancelLimitOrderResponse) -pub struct MsgCancelLimitOrderResponse { - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgCancelLimitOrderResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgCancelLimitOrderResponse { - fn default() -> &'a MsgCancelLimitOrderResponse { - ::default_instance() - } -} - -impl MsgCancelLimitOrderResponse { - pub fn new() -> MsgCancelLimitOrderResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(0); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgCancelLimitOrderResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgCancelLimitOrderResponse { - const NAME: &'static str = "MsgCancelLimitOrderResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgCancelLimitOrderResponse { - MsgCancelLimitOrderResponse::new() - } - - fn clear(&mut self) { - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgCancelLimitOrderResponse { - static instance: MsgCancelLimitOrderResponse = MsgCancelLimitOrderResponse { - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgCancelLimitOrderResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgCancelLimitOrderResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgCancelLimitOrderResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgCancelLimitOrderResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MultiHopRoute) -pub struct MultiHopRoute { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MultiHopRoute.hops) - pub hops: ::std::vec::Vec<::std::string::String>, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MultiHopRoute.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MultiHopRoute { - fn default() -> &'a MultiHopRoute { - ::default_instance() - } -} - -impl MultiHopRoute { - pub fn new() -> MultiHopRoute { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "hops", - |m: &MultiHopRoute| { &m.hops }, - |m: &mut MultiHopRoute| { &mut m.hops }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MultiHopRoute", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MultiHopRoute { - const NAME: &'static str = "MultiHopRoute"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.hops.push(is.read_string()?); - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - for value in &self.hops { - my_size += ::protobuf::rt::string_size(1, &value); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.hops { - os.write_string(1, &v)?; - }; - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MultiHopRoute { - MultiHopRoute::new() - } - - fn clear(&mut self) { - self.hops.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MultiHopRoute { - static instance: MultiHopRoute = MultiHopRoute { - hops: ::std::vec::Vec::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MultiHopRoute { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MultiHopRoute").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MultiHopRoute { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MultiHopRoute { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgMultiHopSwap) -pub struct MsgMultiHopSwap { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.creator) - pub creator: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.receiver) - pub receiver: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.routes) - pub routes: ::std::vec::Vec, - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.amount_in) - pub amount_in: ::std::string::String, - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.exit_limit_price) - pub exit_limit_price: ::std::string::String, - /// If pickBestRoute == true then all routes are run and the route with the best price is chosen - /// otherwise, the first succesful route is used. - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwap.pick_best_route) - pub pick_best_route: bool, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgMultiHopSwap.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgMultiHopSwap { - fn default() -> &'a MsgMultiHopSwap { - ::default_instance() - } -} - -impl MsgMultiHopSwap { - pub fn new() -> MsgMultiHopSwap { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(6); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "creator", - |m: &MsgMultiHopSwap| { &m.creator }, - |m: &mut MsgMultiHopSwap| { &mut m.creator }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "receiver", - |m: &MsgMultiHopSwap| { &m.receiver }, - |m: &mut MsgMultiHopSwap| { &mut m.receiver }, - )); - fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>( - "routes", - |m: &MsgMultiHopSwap| { &m.routes }, - |m: &mut MsgMultiHopSwap| { &mut m.routes }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "amount_in", - |m: &MsgMultiHopSwap| { &m.amount_in }, - |m: &mut MsgMultiHopSwap| { &mut m.amount_in }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "exit_limit_price", - |m: &MsgMultiHopSwap| { &m.exit_limit_price }, - |m: &mut MsgMultiHopSwap| { &mut m.exit_limit_price }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "pick_best_route", - |m: &MsgMultiHopSwap| { &m.pick_best_route }, - |m: &mut MsgMultiHopSwap| { &mut m.pick_best_route }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgMultiHopSwap", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgMultiHopSwap { - const NAME: &'static str = "MsgMultiHopSwap"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.creator = is.read_string()?; - }, - 18 => { - self.receiver = is.read_string()?; - }, - 26 => { - self.routes.push(is.read_message()?); - }, - 34 => { - self.amount_in = is.read_string()?; - }, - 42 => { - self.exit_limit_price = is.read_string()?; - }, - 48 => { - self.pick_best_route = is.read_bool()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.creator.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.creator); - } - if !self.receiver.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.receiver); - } - for value in &self.routes { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - }; - if !self.amount_in.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.amount_in); - } - if !self.exit_limit_price.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.exit_limit_price); - } - if self.pick_best_route != false { - my_size += 1 + 1; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.creator.is_empty() { - os.write_string(1, &self.creator)?; - } - if !self.receiver.is_empty() { - os.write_string(2, &self.receiver)?; - } - for v in &self.routes { - ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?; - }; - if !self.amount_in.is_empty() { - os.write_string(4, &self.amount_in)?; - } - if !self.exit_limit_price.is_empty() { - os.write_string(5, &self.exit_limit_price)?; - } - if self.pick_best_route != false { - os.write_bool(6, self.pick_best_route)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgMultiHopSwap { - MsgMultiHopSwap::new() - } - - fn clear(&mut self) { - self.creator.clear(); - self.receiver.clear(); - self.routes.clear(); - self.amount_in.clear(); - self.exit_limit_price.clear(); - self.pick_best_route = false; - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgMultiHopSwap { - static instance: MsgMultiHopSwap = MsgMultiHopSwap { - creator: ::std::string::String::new(), - receiver: ::std::string::String::new(), - routes: ::std::vec::Vec::new(), - amount_in: ::std::string::String::new(), - exit_limit_price: ::std::string::String::new(), - pick_best_route: false, - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgMultiHopSwap { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgMultiHopSwap").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgMultiHopSwap { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgMultiHopSwap { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgMultiHopSwapResponse) -pub struct MsgMultiHopSwapResponse { - // message fields - // @@protoc_insertion_point(field:neutron.dex.MsgMultiHopSwapResponse.coin_out) - pub coin_out: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgMultiHopSwapResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgMultiHopSwapResponse { - fn default() -> &'a MsgMultiHopSwapResponse { - ::default_instance() - } -} - -impl MsgMultiHopSwapResponse { - pub fn new() -> MsgMultiHopSwapResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(1); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::coin::Coin>( - "coin_out", - |m: &MsgMultiHopSwapResponse| { &m.coin_out }, - |m: &mut MsgMultiHopSwapResponse| { &mut m.coin_out }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgMultiHopSwapResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgMultiHopSwapResponse { - const NAME: &'static str = "MsgMultiHopSwapResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.coin_out)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if let Some(v) = self.coin_out.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if let Some(v) = self.coin_out.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgMultiHopSwapResponse { - MsgMultiHopSwapResponse::new() - } - - fn clear(&mut self) { - self.coin_out.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgMultiHopSwapResponse { - static instance: MsgMultiHopSwapResponse = MsgMultiHopSwapResponse { - coin_out: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgMultiHopSwapResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgMultiHopSwapResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgMultiHopSwapResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgMultiHopSwapResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgUpdateParams) -pub struct MsgUpdateParams { - // message fields - /// Authority is the address of the governance account. - // @@protoc_insertion_point(field:neutron.dex.MsgUpdateParams.authority) - pub authority: ::std::string::String, - /// NOTE: All parameters must be supplied. - // @@protoc_insertion_point(field:neutron.dex.MsgUpdateParams.params) - pub params: ::protobuf::MessageField, - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgUpdateParams.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgUpdateParams { - fn default() -> &'a MsgUpdateParams { - ::default_instance() - } -} - -impl MsgUpdateParams { - pub fn new() -> MsgUpdateParams { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "authority", - |m: &MsgUpdateParams| { &m.authority }, - |m: &mut MsgUpdateParams| { &mut m.authority }, - )); - fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::params::Params>( - "params", - |m: &MsgUpdateParams| { &m.params }, - |m: &mut MsgUpdateParams| { &mut m.params }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgUpdateParams", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 10 => { - self.authority = is.read_string()?; - }, - 18 => { - ::protobuf::rt::read_singular_message_into_field(is, &mut self.params)?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if !self.authority.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.authority); - } - if let Some(v) = self.params.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if !self.authority.is_empty() { - os.write_string(1, &self.authority)?; - } - if let Some(v) = self.params.as_ref() { - ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgUpdateParams { - MsgUpdateParams::new() - } - - fn clear(&mut self) { - self.authority.clear(); - self.params.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgUpdateParams { - static instance: MsgUpdateParams = MsgUpdateParams { - authority: ::std::string::String::new(), - params: ::protobuf::MessageField::none(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgUpdateParams { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgUpdateParams").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgUpdateParams { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgUpdateParams { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: 0.47 -#[derive(PartialEq,Clone,Default,Debug)] -// @@protoc_insertion_point(message:neutron.dex.MsgUpdateParamsResponse) -pub struct MsgUpdateParamsResponse { - // special fields - // @@protoc_insertion_point(special_field:neutron.dex.MsgUpdateParamsResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgUpdateParamsResponse { - fn default() -> &'a MsgUpdateParamsResponse { - ::default_instance() - } -} - -impl MsgUpdateParamsResponse { - pub fn new() -> MsgUpdateParamsResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(0); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgUpdateParamsResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgUpdateParamsResponse { - MsgUpdateParamsResponse::new() - } - - fn clear(&mut self) { - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgUpdateParamsResponse { - static instance: MsgUpdateParamsResponse = MsgUpdateParamsResponse { - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgUpdateParamsResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgUpdateParamsResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgUpdateParamsResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgUpdateParamsResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] -// @@protoc_insertion_point(enum:neutron.dex.LimitOrderType) -pub enum LimitOrderType { - // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.GOOD_TIL_CANCELLED) - GOOD_TIL_CANCELLED = 0, - // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.FILL_OR_KILL) - FILL_OR_KILL = 1, - // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.IMMEDIATE_OR_CANCEL) - IMMEDIATE_OR_CANCEL = 2, - // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.JUST_IN_TIME) - JUST_IN_TIME = 3, - // @@protoc_insertion_point(enum_value:neutron.dex.LimitOrderType.GOOD_TIL_TIME) - GOOD_TIL_TIME = 4, -} - -impl ::protobuf::Enum for LimitOrderType { - const NAME: &'static str = "LimitOrderType"; - - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(LimitOrderType::GOOD_TIL_CANCELLED), - 1 => ::std::option::Option::Some(LimitOrderType::FILL_OR_KILL), - 2 => ::std::option::Option::Some(LimitOrderType::IMMEDIATE_OR_CANCEL), - 3 => ::std::option::Option::Some(LimitOrderType::JUST_IN_TIME), - 4 => ::std::option::Option::Some(LimitOrderType::GOOD_TIL_TIME), - _ => ::std::option::Option::None - } - } - - const VALUES: &'static [LimitOrderType] = &[ - LimitOrderType::GOOD_TIL_CANCELLED, - LimitOrderType::FILL_OR_KILL, - LimitOrderType::IMMEDIATE_OR_CANCEL, - LimitOrderType::JUST_IN_TIME, - LimitOrderType::GOOD_TIL_TIME, - ]; -} - -impl ::protobuf::EnumFull for LimitOrderType { - fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().enum_by_package_relative_name("LimitOrderType").unwrap()).clone() - } - - fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor { - let index = *self as usize; - Self::enum_descriptor().value_by_index(index) - } -} - -impl ::std::default::Default for LimitOrderType { - fn default() -> Self { - LimitOrderType::GOOD_TIL_CANCELLED - } -} - -impl LimitOrderType { - fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData { - ::protobuf::reflect::GeneratedEnumDescriptorData::new::("LimitOrderType") - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x14neutron/dex/tx.proto\x12\x0bneutron.dex\x1a\x14gogoproto/gogo.prot\ - o\x1a\x1ecosmos/base/v1beta1/coin.proto\x1a\x1fgoogle/protobuf/timestamp\ - .proto\x1a\x11amino/amino.proto\x1a\x18neutron/dex/params.proto\x1a\x17c\ - osmos/msg/v1/msg.proto\x1a\x19cosmos_proto/cosmos.proto\";\n\x0eDepositO\ - ptions\x12)\n\x10disable_autoswap\x18\x01\x20\x01(\x08R\x0fdisableAutosw\ - ap\"\xc9\x03\n\nMsgDeposit\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07c\ - reator\x12\x1a\n\x08receiver\x18\x02\x20\x01(\tR\x08receiver\x12\x17\n\ - \x07token_a\x18\x03\x20\x01(\tR\x06tokenA\x12\x17\n\x07token_b\x18\x04\ - \x20\x01(\tR\x06tokenB\x12l\n\tamounts_a\x18\x05\x20\x03(\tR\x08amountsA\ - BO\xf2\xde\x1f\x10yaml:\"amounts_a\"\xda\xde\x1f&github.com/cosmos/cosmo\ - s-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamounts_a\x12l\n\tamounts_b\ - \x18\x06\x20\x03(\tR\x08amountsBBO\xf2\xde\x1f\x10yaml:\"amounts_b\"\xda\ - \xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\ - \x1f\tamounts_b\x12,\n\x13tick_indexes_a_to_b\x18\x07\x20\x03(\x03R\x0ft\ - ickIndexesAToB\x12\x12\n\x04fees\x18\x08\x20\x03(\x04R\x04fees\x125\n\ - \x07options\x18\t\x20\x03(\x0b2\x1b.neutron.dex.DepositOptionsR\x07optio\ - ns\"\xba\x02\n\x12MsgDepositResponse\x12\x90\x01\n\x12reserve0_deposited\ - \x18\x01\x20\x03(\tR\x11reserve0DepositedBa\xf2\xde\x1f\x19yaml:\"reserv\ - e0_deposited\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\ - \xde\x1f\0\xea\xde\x1f\x12reserve0_deposited\x12\x90\x01\n\x12reserve1_d\ - eposited\x18\x02\x20\x03(\tR\x11reserve1DepositedBa\xf2\xde\x1f\x19yaml:\ - \"reserve1_deposited\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.In\ - t\xc8\xde\x1f\0\xea\xde\x1f\x12reserve1_deposited\"\xc3\x02\n\rMsgWithdr\ - awal\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1a\n\x08re\ - ceiver\x18\x02\x20\x01(\tR\x08receiver\x12\x17\n\x07token_a\x18\x03\x20\ - \x01(\tR\x06tokenA\x12\x17\n\x07token_b\x18\x04\x20\x01(\tR\x06tokenB\ - \x12\x87\x01\n\x10shares_to_remove\x18\x05\x20\x03(\tR\x0esharesToRemove\ - B]\xf2\xde\x1f\x17yaml:\"shares_to_remove\"\xda\xde\x1f&github.com/cosmo\ - s/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\x10shares_to_remove\x12\ - ,\n\x13tick_indexes_a_to_b\x18\x06\x20\x03(\x03R\x0ftickIndexesAToB\x12\ - \x12\n\x04fees\x18\x07\x20\x03(\x04R\x04fees\"\x17\n\x15MsgWithdrawalRes\ - ponse\"\xac\x04\n\x12MsgPlaceLimitOrder\x12\x18\n\x07creator\x18\x01\x20\ - \x01(\tR\x07creator\x12\x1a\n\x08receiver\x18\x02\x20\x01(\tR\x08receive\ - r\x12\x19\n\x08token_in\x18\x03\x20\x01(\tR\x07tokenIn\x12\x1b\n\ttoken_\ - out\x18\x04\x20\x01(\tR\x08tokenOut\x12.\n\x14tick_index_in_to_out\x18\ - \x05\x20\x01(\x03R\x10tickIndexInToOut\x12l\n\tamount_in\x18\x07\x20\x01\ - (\tR\x08amountInBO\xf2\xde\x1f\x10yaml:\"amount_in\"\xda\xde\x1f&github.\ - com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamount_in\x12\ - :\n\norder_type\x18\x08\x20\x01(\x0e2\x1b.neutron.dex.LimitOrderTypeR\to\ - rderType\x12M\n\x0fexpiration_time\x18\t\x20\x01(\x0b2\x1a.google.protob\ - uf.TimestampR\x0eexpirationTimeB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x01\x12\ - \x7f\n\x0emax_amount_out\x18\n\x20\x01(\tR\x0cmaxAmountOutBY\xf2\xde\x1f\ - \x15yaml:\"max_amount_out\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/typ\ - es.Int\xc8\xde\x1f\x01\xea\xde\x1f\x0emax_amount_out\"\xdd\x02\n\x1aMsgP\ - laceLimitOrderResponse\x12\x1e\n\ntrancheKey\x18\x01\x20\x01(\tR\ntranch\ - eKey\x12\x80\x01\n\x07coin_in\x18\x02\x20\x01(\x0b2\x19.cosmos.base.v1be\ - ta1.CoinR\x06coinInBL\xf2\xde\x1f\x0eyaml:\"coin_in\"\xc8\xde\x1f\0\xda\ - \xde\x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\xde\x1f\x07coin_in\ - \x12\x9b\x01\n\x0etaker_coin_out\x18\x03\x20\x01(\x0b2\x19.cosmos.base.v\ - 1beta1.CoinR\x0ctakerCoinOutBZ\xf2\xde\x1f\x15yaml:\"taker_coin_out\"\ - \xc8\xde\x1f\0\xda\xde\x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\ - \xde\x1f\x0etaker_coin_out\"X\n\x1bMsgWithdrawFilledLimitOrder\x12\x18\n\ - \x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1f\n\x0btranche_key\x18\ - \x02\x20\x01(\tR\ntrancheKey\"%\n#MsgWithdrawFilledLimitOrderResponse\"P\ - \n\x13MsgCancelLimitOrder\x12\x18\n\x07creator\x18\x01\x20\x01(\tR\x07cr\ - eator\x12\x1f\n\x0btranche_key\x18\x02\x20\x01(\tR\ntrancheKey\"\x1d\n\ - \x1bMsgCancelLimitOrderResponse\"#\n\rMultiHopRoute\x12\x12\n\x04hops\ - \x18\x01\x20\x03(\tR\x04hops\"\xa6\x03\n\x0fMsgMultiHopSwap\x12\x18\n\ - \x07creator\x18\x01\x20\x01(\tR\x07creator\x12\x1a\n\x08receiver\x18\x02\ - \x20\x01(\tR\x08receiver\x122\n\x06routes\x18\x03\x20\x03(\x0b2\x1a.neut\ - ron.dex.MultiHopRouteR\x06routes\x12l\n\tamount_in\x18\x04\x20\x01(\tR\ - \x08amountInBO\xf2\xde\x1f\x10yaml:\"amount_in\"\xda\xde\x1f&github.com/\ - cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\0\xea\xde\x1f\tamount_in\x12\x92\ - \x01\n\x10exit_limit_price\x18\x05\x20\x01(\tR\x0eexitLimitPriceBh\xf2\ - \xde\x1f\x17yaml:\"exit_limit_price\"\xda\xde\x1f1github.com/neutron-org\ - /neutron/utils/math.PrecDec\xc8\xde\x1f\0\xea\xde\x1f\x10exit_limit_pric\ - e\x12&\n\x0fpick_best_route\x18\x06\x20\x01(\x08R\rpickBestRoute\"\x8c\ - \x01\n\x17MsgMultiHopSwapResponse\x12q\n\x08coin_out\x18\x01\x20\x01(\ - \x0b2\x19.cosmos.base.v1beta1.CoinR\x07coinOutB;\xc8\xde\x1f\0\xda\xde\ - \x1f'github.com/cosmos/cosmos-sdk/types.Coin\xea\xde\x1f\x08coin_out\"\ - \xa9\x01\n\x0fMsgUpdateParams\x126\n\tauthority\x18\x01\x20\x01(\tR\taut\ - horityB\x18\xd2\xb4-\x14cosmos.AddressString\x126\n\x06params\x18\x02\ - \x20\x01(\x0b2\x13.neutron.dex.ParamsR\x06paramsB\t\xc8\xde\x1f\0\xa8\ - \xe7\xb0*\x01:&\x8a\xe7\xb0*\x13dex/MsgUpdateParams\x82\xe7\xb0*\tauthor\ - ity\"\x19\n\x17MsgUpdateParamsResponse*x\n\x0eLimitOrderType\x12\x16\n\ - \x12GOOD_TIL_CANCELLED\x10\0\x12\x10\n\x0cFILL_OR_KILL\x10\x01\x12\x17\n\ - \x13IMMEDIATE_OR_CANCEL\x10\x02\x12\x10\n\x0cJUST_IN_TIME\x10\x03\x12\ - \x11\n\rGOOD_TIL_TIME\x10\x042\xf5\x04\n\x03Msg\x12C\n\x07Deposit\x12\ - \x17.neutron.dex.MsgDeposit\x1a\x1f.neutron.dex.MsgDepositResponse\x12L\ - \n\nWithdrawal\x12\x1a.neutron.dex.MsgWithdrawal\x1a\".neutron.dex.MsgWi\ - thdrawalResponse\x12[\n\x0fPlaceLimitOrder\x12\x1f.neutron.dex.MsgPlaceL\ - imitOrder\x1a'.neutron.dex.MsgPlaceLimitOrderResponse\x12v\n\x18Withdraw\ - FilledLimitOrder\x12(.neutron.dex.MsgWithdrawFilledLimitOrder\x1a0.neutr\ - on.dex.MsgWithdrawFilledLimitOrderResponse\x12^\n\x10CancelLimitOrder\ - \x12\x20.neutron.dex.MsgCancelLimitOrder\x1a(.neutron.dex.MsgCancelLimit\ - OrderResponse\x12R\n\x0cMultiHopSwap\x12\x1c.neutron.dex.MsgMultiHopSwap\ - \x1a$.neutron.dex.MsgMultiHopSwapResponse\x12R\n\x0cUpdateParams\x12\x1c\ - .neutron.dex.MsgUpdateParams\x1a$.neutron.dex.MsgUpdateParamsResponseB,Z\ - *github.com/neutron-org/neutron/x/dex/typesJ\xf7.\n\x07\x12\x05\0\0\xcd\ - \x01\"\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\0\x14\ - \n\x08\n\x01\x08\x12\x03\x05\0A\nH\n\x02\x08\x0b\x12\x03\x05\0A2=\x20thi\ - s\x20line\x20is\x20used\x20by\x20starport\x20scaffolding\x20#\x20proto/t\ - x/import\n\n\t\n\x02\x03\0\x12\x03\x06\0\x1e\n\t\n\x02\x03\x01\x12\x03\ - \x07\0(\n\t\n\x02\x03\x02\x12\x03\x08\0)\n\t\n\x02\x03\x03\x12\x03\t\0\ - \x1b\n\t\n\x02\x03\x04\x12\x03\n\0\"\n\t\n\x02\x03\x05\x12\x03\x0b\0!\n\ - \t\n\x02\x03\x06\x12\x03\x0c\0#\n*\n\x02\x06\0\x12\x04\x0f\0\x18\x01\x1a\ - \x1e\x20Msg\x20defines\x20the\x20Msg\x20service.\n\n\n\n\x03\x06\0\x01\ - \x12\x03\x0f\x08\x0b\n\x0b\n\x04\x06\0\x02\0\x12\x03\x10\x027\n\x0c\n\ - \x05\x06\0\x02\0\x01\x12\x03\x10\x06\r\n\x0c\n\x05\x06\0\x02\0\x02\x12\ - \x03\x10\x0e\x18\n\x0c\n\x05\x06\0\x02\0\x03\x12\x03\x10#5\n\x0b\n\x04\ - \x06\0\x02\x01\x12\x03\x11\x02@\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x03\ - \x11\x06\x10\n\x0c\n\x05\x06\0\x02\x01\x02\x12\x03\x11\x11\x1e\n\x0c\n\ - \x05\x06\0\x02\x01\x03\x12\x03\x11)>\n\x0b\n\x04\x06\0\x02\x02\x12\x03\ - \x12\x02O\n\x0c\n\x05\x06\0\x02\x02\x01\x12\x03\x12\x06\x15\n\x0c\n\x05\ - \x06\0\x02\x02\x02\x12\x03\x12\x16(\n\x0c\n\x05\x06\0\x02\x02\x03\x12\ - \x03\x123M\n\x0b\n\x04\x06\0\x02\x03\x12\x03\x13\x02j\n\x0c\n\x05\x06\0\ - \x02\x03\x01\x12\x03\x13\x06\x1e\n\x0c\n\x05\x06\0\x02\x03\x02\x12\x03\ - \x13\x1f:\n\x0c\n\x05\x06\0\x02\x03\x03\x12\x03\x13Eh\n\x0b\n\x04\x06\0\ - \x02\x04\x12\x03\x14\x02R\n\x0c\n\x05\x06\0\x02\x04\x01\x12\x03\x14\x06\ - \x16\n\x0c\n\x05\x06\0\x02\x04\x02\x12\x03\x14\x17*\n\x0c\n\x05\x06\0\ - \x02\x04\x03\x12\x03\x145P\n\x0b\n\x04\x06\0\x02\x05\x12\x03\x15\x02F\n\ - \x0c\n\x05\x06\0\x02\x05\x01\x12\x03\x15\x06\x12\n\x0c\n\x05\x06\0\x02\ - \x05\x02\x12\x03\x15\x13\"\n\x0c\n\x05\x06\0\x02\x05\x03\x12\x03\x15-D\n\ - G\n\x04\x06\0\x02\x06\x12\x03\x16\x02F\":\x20this\x20line\x20is\x20used\ - \x20by\x20starport\x20scaffolding\x20#\x20proto/tx/rpc\n\n\x0c\n\x05\x06\ - \0\x02\x06\x01\x12\x03\x16\x06\x12\n\x0c\n\x05\x06\0\x02\x06\x02\x12\x03\ - \x16\x13\"\n\x0c\n\x05\x06\0\x02\x06\x03\x12\x03\x16-D\n\n\n\x02\x04\0\ - \x12\x04\x1a\0\x1c\x01\n\n\n\x03\x04\0\x01\x12\x03\x1a\x08\x16\n\x0b\n\ - \x04\x04\0\x02\0\x12\x03\x1b\x02\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\ - \x1b\x02\x06\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x1b\x07\x17\n\x0c\n\x05\ - \x04\0\x02\0\x03\x12\x03\x1b\x1a\x1b\n\n\n\x02\x04\x01\x12\x04\x1e\02\ - \x01\n\n\n\x03\x04\x01\x01\x12\x03\x1e\x08\x12\n\x0b\n\x04\x04\x01\x02\0\ - \x12\x03\x1f\x02\x15\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x1f\x02\x08\n\ - \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x1f\t\x10\n\x0c\n\x05\x04\x01\x02\0\ - \x03\x12\x03\x1f\x13\x14\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x20\x02\x16\ - \n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x20\x02\x08\n\x0c\n\x05\x04\x01\ - \x02\x01\x01\x12\x03\x20\t\x11\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\ - \x20\x14\x15\n\x0b\n\x04\x04\x01\x02\x02\x12\x03!\x02\x15\n\x0c\n\x05\ - \x04\x01\x02\x02\x05\x12\x03!\x02\x08\n\x0c\n\x05\x04\x01\x02\x02\x01\ - \x12\x03!\t\x10\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03!\x13\x14\n\x0b\n\ - \x04\x04\x01\x02\x03\x12\x03\"\x02\x15\n\x0c\n\x05\x04\x01\x02\x03\x05\ - \x12\x03\"\x02\x08\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\"\t\x10\n\x0c\ - \n\x05\x04\x01\x02\x03\x03\x12\x03\"\x13\x14\n\x0c\n\x04\x04\x01\x02\x04\ - \x12\x04#\x02(\x04\n\x0c\n\x05\x04\x01\x02\x04\x04\x12\x03#\x02\n\n\x0c\ - \n\x05\x04\x01\x02\x04\x05\x12\x03#\x0b\x11\n\x0c\n\x05\x04\x01\x02\x04\ - \x01\x12\x03#\x12\x1b\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03#\x1e\x1f\n\ - \r\n\x05\x04\x01\x02\x04\x08\x12\x04#!(\x03\n\x0f\n\x08\x04\x01\x02\x04\ - \x08\xee\xfb\x03\x12\x03$\x063\n\x0f\n\x08\x04\x01\x02\x04\x08\xeb\xfb\ - \x03\x12\x03%\x06G\n\x0f\n\x08\x04\x01\x02\x04\x08\xe9\xfb\x03\x12\x03&\ - \x06$\n\x0f\n\x08\x04\x01\x02\x04\x08\xed\xfb\x03\x12\x03'\x06'\n\x0c\n\ - \x04\x04\x01\x02\x05\x12\x04)\x03.\x04\n\x0c\n\x05\x04\x01\x02\x05\x04\ - \x12\x03)\x03\x0b\n\x0c\n\x05\x04\x01\x02\x05\x05\x12\x03)\x0c\x12\n\x0c\ - \n\x05\x04\x01\x02\x05\x01\x12\x03)\x13\x1c\n\x0c\n\x05\x04\x01\x02\x05\ - \x03\x12\x03)\x1f\x20\n\r\n\x05\x04\x01\x02\x05\x08\x12\x04)\".\x03\n\ - \x0f\n\x08\x04\x01\x02\x05\x08\xee\xfb\x03\x12\x03*\x063\n\x0f\n\x08\x04\ - \x01\x02\x05\x08\xeb\xfb\x03\x12\x03+\x06G\n\x0f\n\x08\x04\x01\x02\x05\ - \x08\xe9\xfb\x03\x12\x03,\x06$\n\x0f\n\x08\x04\x01\x02\x05\x08\xed\xfb\ - \x03\x12\x03-\x06'\n\x0b\n\x04\x04\x01\x02\x06\x12\x03/\x02)\n\x0c\n\x05\ - \x04\x01\x02\x06\x04\x12\x03/\x02\n\n\x0c\n\x05\x04\x01\x02\x06\x05\x12\ - \x03/\x0b\x10\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x03/\x11$\n\x0c\n\x05\ - \x04\x01\x02\x06\x03\x12\x03/'(\n\x0b\n\x04\x04\x01\x02\x07\x12\x030\x02\ - \x1b\n\x0c\n\x05\x04\x01\x02\x07\x04\x12\x030\x02\n\n\x0c\n\x05\x04\x01\ - \x02\x07\x05\x12\x030\x0b\x11\n\x0c\n\x05\x04\x01\x02\x07\x01\x12\x030\ - \x12\x16\n\x0c\n\x05\x04\x01\x02\x07\x03\x12\x030\x19\x1a\n\x0b\n\x04\ - \x04\x01\x02\x08\x12\x031\x02&\n\x0c\n\x05\x04\x01\x02\x08\x04\x12\x031\ - \x02\n\n\x0c\n\x05\x04\x01\x02\x08\x06\x12\x031\x0b\x19\n\x0c\n\x05\x04\ - \x01\x02\x08\x01\x12\x031\x1a!\n\x0c\n\x05\x04\x01\x02\x08\x03\x12\x031$\ - %\n\n\n\x02\x04\x02\x12\x044\0A\x01\n\n\n\x03\x04\x02\x01\x12\x034\x08\ - \x1a\n\x0c\n\x04\x04\x02\x02\0\x12\x045\x03:\x04\n\x0c\n\x05\x04\x02\x02\ - \0\x04\x12\x035\x03\x0b\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x035\x0c\x12\n\ - \x0c\n\x05\x04\x02\x02\0\x01\x12\x035\x13%\n\x0c\n\x05\x04\x02\x02\0\x03\ - \x12\x035()\n\r\n\x05\x04\x02\x02\0\x08\x12\x045*:\x03\n\x0f\n\x08\x04\ - \x02\x02\0\x08\xee\xfb\x03\x12\x036\x06<\n\x0f\n\x08\x04\x02\x02\0\x08\ - \xeb\xfb\x03\x12\x037\x06G\n\x0f\n\x08\x04\x02\x02\0\x08\xe9\xfb\x03\x12\ - \x038\x06$\n\x0f\n\x08\x04\x02\x02\0\x08\xed\xfb\x03\x12\x039\x060\n\x0c\ - \n\x04\x04\x02\x02\x01\x12\x04;\x02@\x04\n\x0c\n\x05\x04\x02\x02\x01\x04\ - \x12\x03;\x02\n\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03;\x0b\x11\n\x0c\n\ - \x05\x04\x02\x02\x01\x01\x12\x03;\x12$\n\x0c\n\x05\x04\x02\x02\x01\x03\ - \x12\x03;'(\n\r\n\x05\x04\x02\x02\x01\x08\x12\x04;(@\x03\n\x0f\n\x08\x04\ - \x02\x02\x01\x08\xee\xfb\x03\x12\x03<\x06<\n\x0f\n\x08\x04\x02\x02\x01\ - \x08\xeb\xfb\x03\x12\x03=\x06G\n\x0f\n\x08\x04\x02\x02\x01\x08\xe9\xfb\ - \x03\x12\x03>\x06$\n\x0f\n\x08\x04\x02\x02\x01\x08\xed\xfb\x03\x12\x03?\ - \x060\n\n\n\x02\x04\x03\x12\x04C\0Q\x01\n\n\n\x03\x04\x03\x01\x12\x03C\ - \x08\x15\n\x0b\n\x04\x04\x03\x02\0\x12\x03D\x02\x15\n\x0c\n\x05\x04\x03\ - \x02\0\x05\x12\x03D\x02\x08\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03D\t\x10\ - \n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03D\x13\x14\n\x0b\n\x04\x04\x03\x02\ - \x01\x12\x03E\x02\x16\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03E\x02\x08\n\ - \x0c\n\x05\x04\x03\x02\x01\x01\x12\x03E\t\x11\n\x0c\n\x05\x04\x03\x02\ - \x01\x03\x12\x03E\x14\x15\n\x0b\n\x04\x04\x03\x02\x02\x12\x03F\x02\x15\n\ - \x0c\n\x05\x04\x03\x02\x02\x05\x12\x03F\x02\x08\n\x0c\n\x05\x04\x03\x02\ - \x02\x01\x12\x03F\t\x10\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03F\x13\x14\ - \n\x0b\n\x04\x04\x03\x02\x03\x12\x03G\x02\x15\n\x0c\n\x05\x04\x03\x02\ - \x03\x05\x12\x03G\x02\x08\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03G\t\x10\ - \n\x0c\n\x05\x04\x03\x02\x03\x03\x12\x03G\x13\x14\n\x0c\n\x04\x04\x03\ - \x02\x04\x12\x04H\x02M\x04\n\x0c\n\x05\x04\x03\x02\x04\x04\x12\x03H\x02\ - \n\n\x0c\n\x05\x04\x03\x02\x04\x05\x12\x03H\x0b\x11\n\x0c\n\x05\x04\x03\ - \x02\x04\x01\x12\x03H\x12\"\n\x0c\n\x05\x04\x03\x02\x04\x03\x12\x03H%&\n\ - \r\n\x05\x04\x03\x02\x04\x08\x12\x04H(M\x03\n\x0f\n\x08\x04\x03\x02\x04\ - \x08\xee\xfb\x03\x12\x03I\x06:\n\x0f\n\x08\x04\x03\x02\x04\x08\xeb\xfb\ - \x03\x12\x03J\x06G\n\x0f\n\x08\x04\x03\x02\x04\x08\xe9\xfb\x03\x12\x03K\ - \x06$\n\x0f\n\x08\x04\x03\x02\x04\x08\xed\xfb\x03\x12\x03L\x06.\n\x0b\n\ - \x04\x04\x03\x02\x05\x12\x03N\x02)\n\x0c\n\x05\x04\x03\x02\x05\x04\x12\ - \x03N\x02\n\n\x0c\n\x05\x04\x03\x02\x05\x05\x12\x03N\x0b\x10\n\x0c\n\x05\ - \x04\x03\x02\x05\x01\x12\x03N\x11$\n\x0c\n\x05\x04\x03\x02\x05\x03\x12\ - \x03N'(\n\x0b\n\x04\x04\x03\x02\x06\x12\x03O\x02\x1b\n\x0c\n\x05\x04\x03\ - \x02\x06\x04\x12\x03O\x02\n\n\x0c\n\x05\x04\x03\x02\x06\x05\x12\x03O\x0b\ - \x11\n\x0c\n\x05\x04\x03\x02\x06\x01\x12\x03O\x12\x16\n\x0c\n\x05\x04\ - \x03\x02\x06\x03\x12\x03O\x19\x1a\n\n\n\x02\x04\x04\x12\x04S\0T\x01\n\n\ - \n\x03\x04\x04\x01\x12\x03S\x08\x1d\n\n\n\x02\x05\0\x12\x04V\0\\\x01\n\n\ - \n\x03\x05\0\x01\x12\x03V\x05\x13\n\x0b\n\x04\x05\0\x02\0\x12\x03W\x02\ - \x19\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03W\x02\x14\n\x0c\n\x05\x05\0\x02\ - \0\x02\x12\x03W\x17\x18\n\x0b\n\x04\x05\0\x02\x01\x12\x03X\x02\x13\n\x0c\ - \n\x05\x05\0\x02\x01\x01\x12\x03X\x02\x0e\n\x0c\n\x05\x05\0\x02\x01\x02\ - \x12\x03X\x11\x12\n\x0b\n\x04\x05\0\x02\x02\x12\x03Y\x02\x1a\n\x0c\n\x05\ - \x05\0\x02\x02\x01\x12\x03Y\x02\x15\n\x0c\n\x05\x05\0\x02\x02\x02\x12\ - \x03Y\x18\x19\n\x0b\n\x04\x05\0\x02\x03\x12\x03Z\x02\x13\n\x0c\n\x05\x05\ - \0\x02\x03\x01\x12\x03Z\x02\x0e\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03Z\ - \x11\x12\n\x0b\n\x04\x05\0\x02\x04\x12\x03[\x02\x14\n\x0c\n\x05\x05\0\ - \x02\x04\x01\x12\x03[\x02\x0f\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03[\x12\ - \x13\n\n\n\x02\x04\x05\x12\x04^\0v\x01\n\n\n\x03\x04\x05\x01\x12\x03^\ - \x08\x1a\n\x0b\n\x04\x04\x05\x02\0\x12\x03_\x02\x15\n\x0c\n\x05\x04\x05\ - \x02\0\x05\x12\x03_\x02\x08\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03_\t\x10\ - \n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03_\x13\x14\n\x0b\n\x04\x04\x05\x02\ - \x01\x12\x03`\x02\x16\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\x03`\x02\x08\n\ - \x0c\n\x05\x04\x05\x02\x01\x01\x12\x03`\t\x11\n\x0c\n\x05\x04\x05\x02\ - \x01\x03\x12\x03`\x14\x15\n\x0b\n\x04\x04\x05\x02\x02\x12\x03a\x02\x16\n\ - \x0c\n\x05\x04\x05\x02\x02\x05\x12\x03a\x02\x08\n\x0c\n\x05\x04\x05\x02\ - \x02\x01\x12\x03a\t\x11\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03a\x14\x15\ - \n\x0b\n\x04\x04\x05\x02\x03\x12\x03b\x02\x17\n\x0c\n\x05\x04\x05\x02\ - \x03\x05\x12\x03b\x02\x08\n\x0c\n\x05\x04\x05\x02\x03\x01\x12\x03b\t\x12\ - \n\x0c\n\x05\x04\x05\x02\x03\x03\x12\x03b\x15\x16\n\x0b\n\x04\x04\x05\ - \x02\x04\x12\x03c\x02!\n\x0c\n\x05\x04\x05\x02\x04\x05\x12\x03c\x02\x07\ - \n\x0c\n\x05\x04\x05\x02\x04\x01\x12\x03c\x08\x1c\n\x0c\n\x05\x04\x05\ - \x02\x04\x03\x12\x03c\x1f\x20\n\x0c\n\x04\x04\x05\x02\x05\x12\x04d\x02i\ - \x04\n\x0c\n\x05\x04\x05\x02\x05\x05\x12\x03d\x02\x08\n\x0c\n\x05\x04\ - \x05\x02\x05\x01\x12\x03d\t\x12\n\x0c\n\x05\x04\x05\x02\x05\x03\x12\x03d\ - \x15\x16\n\r\n\x05\x04\x05\x02\x05\x08\x12\x04d\x17i\x03\n\x0f\n\x08\x04\ - \x05\x02\x05\x08\xee\xfb\x03\x12\x03e\x063\n\x0f\n\x08\x04\x05\x02\x05\ - \x08\xeb\xfb\x03\x12\x03f\x06G\n\x0f\n\x08\x04\x05\x02\x05\x08\xe9\xfb\ - \x03\x12\x03g\x06$\n\x0f\n\x08\x04\x05\x02\x05\x08\xed\xfb\x03\x12\x03h\ - \x06'\n\x0b\n\x04\x04\x05\x02\x06\x12\x03j\x02\x20\n\x0c\n\x05\x04\x05\ - \x02\x06\x06\x12\x03j\x02\x10\n\x0c\n\x05\x04\x05\x02\x06\x01\x12\x03j\ - \x11\x1b\n\x0c\n\x05\x04\x05\x02\x06\x03\x12\x03j\x1e\x1f\nL\n\x04\x04\ - \x05\x02\x07\x12\x04l\x02o/\x1a>\x20expirationTime\x20is\x20only\x20vali\ - d\x20iff\x20orderType\x20==\x20GOOD_TIL_TIME.\n\n\x0c\n\x05\x04\x05\x02\ - \x07\x06\x12\x03l\x02\x1b\n\x0c\n\x05\x04\x05\x02\x07\x01\x12\x03l\x1c+\ - \n\x0c\n\x05\x04\x05\x02\x07\x03\x12\x03l./\n\r\n\x05\x04\x05\x02\x07\ - \x08\x12\x04l0o.\n\x0f\n\x08\x04\x05\x02\x07\x08\xf2\xfb\x03\x12\x03m-G\ - \n\x0f\n\x08\x04\x05\x02\x07\x08\xe9\xfb\x03\x12\x03n-H\n\x0c\n\x04\x04\ - \x05\x02\x08\x12\x04p\x02u\x19\n\x0c\n\x05\x04\x05\x02\x08\x05\x12\x03p\ - \x02\x08\n\x0c\n\x05\x04\x05\x02\x08\x01\x12\x03p\t\x17\n\x0c\n\x05\x04\ - \x05\x02\x08\x03\x12\x03p\x1a\x1c\n\r\n\x05\x04\x05\x02\x08\x08\x12\x04p\ - \x1du\x18\n\x0f\n\x08\x04\x05\x02\x08\x08\xee\xfb\x03\x12\x03q\x17I\n\ - \x0f\n\x08\x04\x05\x02\x08\x08\xeb\xfb\x03\x12\x03r\x17X\n\x0f\n\x08\x04\ - \x05\x02\x08\x08\xe9\xfb\x03\x12\x03s\x174\n\x0f\n\x08\x04\x05\x02\x08\ - \x08\xed\xfb\x03\x12\x03t\x17=\n\x0b\n\x02\x04\x06\x12\x05x\0\x8b\x01\ - \x01\n\n\n\x03\x04\x06\x01\x12\x03x\x08\"\n\x0b\n\x04\x04\x06\x02\0\x12\ - \x03y\x02\x18\n\x0c\n\x05\x04\x06\x02\0\x05\x12\x03y\x02\x08\n\x0c\n\x05\ - \x04\x06\x02\0\x01\x12\x03y\t\x13\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03y\ - \x16\x17\n>\n\x04\x04\x06\x02\x01\x12\x05{\x02\x80\x01/\x1a/\x20Total\ - \x20amount\x20of\x20coin\x20used\x20for\x20the\x20limit\x20order\n\n\x0c\ - \n\x05\x04\x06\x02\x01\x06\x12\x03{\x02\x1a\n\x0c\n\x05\x04\x06\x02\x01\ - \x01\x12\x03{\x1b\"\n\x0c\n\x05\x04\x06\x02\x01\x03\x12\x03{%&\n\x0e\n\ - \x05\x04\x06\x02\x01\x08\x12\x05{'\x80\x01.\n\x0f\n\x08\x04\x06\x02\x01\ - \x08\xee\xfb\x03\x12\x03|'R\n\x0f\n\x08\x04\x06\x02\x01\x08\xe9\xfb\x03\ - \x12\x03}-I\n\x0f\n\x08\x04\x06\x02\x01\x08\xeb\xfb\x03\x12\x03~-o\n\x0f\ - \n\x08\x04\x06\x02\x01\x08\xed\xfb\x03\x12\x03\x7f-L\n\xaa\x02\n\x04\x04\ - \x06\x02\x02\x12\x06\x84\x01\x02\x89\x01*\x1a\x99\x02\x20Total\x20amount\ - \x20of\x20coin\x20received\x20from\x20the\x20taker\x20portion\x20of\x20t\ - he\x20limit\x20order\n\x20This\x20is\x20the\x20amount\x20of\x20coin\x20i\ - mmediately\x20available\x20in\x20the\x20users\x20account\x20after\x20exe\ - cuting\x20the\n\x20limit\x20order.\x20It\x20does\x20not\x20include\x20an\ - y\x20future\x20proceeds\x20from\x20the\x20maker\x20portion\x20which\x20w\ - ill\x20have\x20withdrawn\x20in\x20the\x20future\n\n\r\n\x05\x04\x06\x02\ - \x02\x06\x12\x04\x84\x01\x02\x1a\n\r\n\x05\x04\x06\x02\x02\x01\x12\x04\ - \x84\x01\x1b)\n\r\n\x05\x04\x06\x02\x02\x03\x12\x04\x84\x01,-\n\x0f\n\ - \x05\x04\x06\x02\x02\x08\x12\x06\x84\x01.\x89\x01)\n\x10\n\x08\x04\x06\ - \x02\x02\x08\xee\xfb\x03\x12\x04\x85\x01-_\n\x10\n\x08\x04\x06\x02\x02\ - \x08\xe9\xfb\x03\x12\x04\x86\x01(D\n\x10\n\x08\x04\x06\x02\x02\x08\xeb\ - \xfb\x03\x12\x04\x87\x01(j\n\x10\n\x08\x04\x06\x02\x02\x08\xed\xfb\x03\ - \x12\x04\x88\x01-S\n\x0c\n\x02\x04\x07\x12\x06\x8d\x01\0\x90\x01\x01\n\ - \x0b\n\x03\x04\x07\x01\x12\x04\x8d\x01\x08#\n\x0c\n\x04\x04\x07\x02\0\ - \x12\x04\x8e\x01\x02\x15\n\r\n\x05\x04\x07\x02\0\x05\x12\x04\x8e\x01\x02\ - \x08\n\r\n\x05\x04\x07\x02\0\x01\x12\x04\x8e\x01\t\x10\n\r\n\x05\x04\x07\ - \x02\0\x03\x12\x04\x8e\x01\x13\x14\n\x0c\n\x04\x04\x07\x02\x01\x12\x04\ - \x8f\x01\x02\x19\n\r\n\x05\x04\x07\x02\x01\x05\x12\x04\x8f\x01\x02\x08\n\ - \r\n\x05\x04\x07\x02\x01\x01\x12\x04\x8f\x01\t\x14\n\r\n\x05\x04\x07\x02\ - \x01\x03\x12\x04\x8f\x01\x17\x18\n\x0c\n\x02\x04\x08\x12\x06\x92\x01\0\ - \x93\x01\x01\n\x0b\n\x03\x04\x08\x01\x12\x04\x92\x01\x08+\n\x0c\n\x02\ - \x04\t\x12\x06\x95\x01\0\x98\x01\x01\n\x0b\n\x03\x04\t\x01\x12\x04\x95\ - \x01\x08\x1b\n\x0c\n\x04\x04\t\x02\0\x12\x04\x96\x01\x02\x15\n\r\n\x05\ - \x04\t\x02\0\x05\x12\x04\x96\x01\x02\x08\n\r\n\x05\x04\t\x02\0\x01\x12\ - \x04\x96\x01\t\x10\n\r\n\x05\x04\t\x02\0\x03\x12\x04\x96\x01\x13\x14\n\ - \x0c\n\x04\x04\t\x02\x01\x12\x04\x97\x01\x02\x19\n\r\n\x05\x04\t\x02\x01\ - \x05\x12\x04\x97\x01\x02\x08\n\r\n\x05\x04\t\x02\x01\x01\x12\x04\x97\x01\ - \t\x14\n\r\n\x05\x04\t\x02\x01\x03\x12\x04\x97\x01\x17\x18\n\x0c\n\x02\ - \x04\n\x12\x06\x9a\x01\0\x9b\x01\x01\n\x0b\n\x03\x04\n\x01\x12\x04\x9a\ - \x01\x08#\n\x0c\n\x02\x04\x0b\x12\x06\x9d\x01\0\x9f\x01\x01\n\x0b\n\x03\ - \x04\x0b\x01\x12\x04\x9d\x01\x08\x15\n\x0c\n\x04\x04\x0b\x02\0\x12\x04\ - \x9e\x01\x02\x1b\n\r\n\x05\x04\x0b\x02\0\x04\x12\x04\x9e\x01\x02\n\n\r\n\ - \x05\x04\x0b\x02\0\x05\x12\x04\x9e\x01\x0b\x11\n\r\n\x05\x04\x0b\x02\0\ - \x01\x12\x04\x9e\x01\x12\x16\n\r\n\x05\x04\x0b\x02\0\x03\x12\x04\x9e\x01\ - \x19\x1a\n\x0c\n\x02\x04\x0c\x12\x06\xa1\x01\0\xb4\x01\x01\n\x0b\n\x03\ - \x04\x0c\x01\x12\x04\xa1\x01\x08\x17\n\x0c\n\x04\x04\x0c\x02\0\x12\x04\ - \xa2\x01\x02\x15\n\r\n\x05\x04\x0c\x02\0\x05\x12\x04\xa2\x01\x02\x08\n\r\ - \n\x05\x04\x0c\x02\0\x01\x12\x04\xa2\x01\t\x10\n\r\n\x05\x04\x0c\x02\0\ - \x03\x12\x04\xa2\x01\x13\x14\n\x0c\n\x04\x04\x0c\x02\x01\x12\x04\xa3\x01\ - \x02\x16\n\r\n\x05\x04\x0c\x02\x01\x05\x12\x04\xa3\x01\x02\x08\n\r\n\x05\ - \x04\x0c\x02\x01\x01\x12\x04\xa3\x01\t\x11\n\r\n\x05\x04\x0c\x02\x01\x03\ - \x12\x04\xa3\x01\x14\x15\n\x0c\n\x04\x04\x0c\x02\x02\x12\x04\xa4\x01\x02\ - $\n\r\n\x05\x04\x0c\x02\x02\x04\x12\x04\xa4\x01\x02\n\n\r\n\x05\x04\x0c\ - \x02\x02\x06\x12\x04\xa4\x01\x0b\x18\n\r\n\x05\x04\x0c\x02\x02\x01\x12\ - \x04\xa4\x01\x19\x1f\n\r\n\x05\x04\x0c\x02\x02\x03\x12\x04\xa4\x01\"#\n\ - \x0e\n\x04\x04\x0c\x02\x03\x12\x06\xa5\x01\x02\xaa\x01\x19\n\r\n\x05\x04\ - \x0c\x02\x03\x05\x12\x04\xa5\x01\x02\x08\n\r\n\x05\x04\x0c\x02\x03\x01\ - \x12\x04\xa5\x01\t\x12\n\r\n\x05\x04\x0c\x02\x03\x03\x12\x04\xa5\x01\x15\ - \x16\n\x0f\n\x05\x04\x0c\x02\x03\x08\x12\x06\xa5\x01\x17\xaa\x01\x18\n\ - \x10\n\x08\x04\x0c\x02\x03\x08\xee\xfb\x03\x12\x04\xa6\x01\x17D\n\x10\n\ - \x08\x04\x0c\x02\x03\x08\xeb\xfb\x03\x12\x04\xa7\x01\x17X\n\x10\n\x08\ - \x04\x0c\x02\x03\x08\xe9\xfb\x03\x12\x04\xa8\x01\x175\n\x10\n\x08\x04\ - \x0c\x02\x03\x08\xed\xfb\x03\x12\x04\xa9\x01\x178\n\x0e\n\x04\x04\x0c\ - \x02\x04\x12\x06\xab\x01\x02\xb0\x01\x1f\n\r\n\x05\x04\x0c\x02\x04\x05\ - \x12\x04\xab\x01\x02\x08\n\r\n\x05\x04\x0c\x02\x04\x01\x12\x04\xab\x01\t\ - \x19\n\r\n\x05\x04\x0c\x02\x04\x03\x12\x04\xab\x01\x1c\x1d\n\x0f\n\x05\ - \x04\x0c\x02\x04\x08\x12\x06\xab\x01\x1e\xb0\x01\x1e\n\x10\n\x08\x04\x0c\ - \x02\x04\x08\xee\xfb\x03\x12\x04\xac\x01\x1dQ\n\x10\n\x08\x04\x0c\x02\ - \x04\x08\xeb\xfb\x03\x12\x04\xad\x01\x1di\n\x10\n\x08\x04\x0c\x02\x04\ - \x08\xe9\xfb\x03\x12\x04\xae\x01\x1d;\n\x10\n\x08\x04\x0c\x02\x04\x08\ - \xed\xfb\x03\x12\x04\xaf\x01\x1dE\n\x9c\x01\n\x04\x04\x0c\x02\x05\x12\ - \x04\xb3\x01\x02\x1b\x1a\x8d\x01\x20If\x20pickBestRoute\x20==\x20true\ - \x20then\x20all\x20routes\x20are\x20run\x20and\x20the\x20route\x20with\ - \x20the\x20best\x20price\x20is\x20chosen\n\x20otherwise,\x20the\x20first\ - \x20succesful\x20route\x20is\x20used.\n\n\r\n\x05\x04\x0c\x02\x05\x05\ - \x12\x04\xb3\x01\x02\x06\n\r\n\x05\x04\x0c\x02\x05\x01\x12\x04\xb3\x01\ - \x07\x16\n\r\n\x05\x04\x0c\x02\x05\x03\x12\x04\xb3\x01\x19\x1a\n\x0c\n\ - \x02\x04\r\x12\x06\xb6\x01\0\xbc\x01\x01\n\x0b\n\x03\x04\r\x01\x12\x04\ - \xb6\x01\x08\x1f\n\x0e\n\x04\x04\r\x02\0\x12\x06\xb7\x01\x02\xbb\x01*\n\ - \r\n\x05\x04\r\x02\0\x06\x12\x04\xb7\x01\x02\x1a\n\r\n\x05\x04\r\x02\0\ - \x01\x12\x04\xb7\x01\x1b#\n\r\n\x05\x04\r\x02\0\x03\x12\x04\xb7\x01&'\n\ - \x0f\n\x05\x04\r\x02\0\x08\x12\x06\xb7\x01(\xbb\x01)\n\x10\n\x08\x04\r\ - \x02\0\x08\xe9\xfb\x03\x12\x04\xb8\x01(D\n\x10\n\x08\x04\r\x02\0\x08\xeb\ - \xfb\x03\x12\x04\xb9\x01(j\n\x10\n\x08\x04\r\x02\0\x08\xed\xfb\x03\x12\ - \x04\xba\x01(H\n\x0c\n\x02\x04\x0e\x12\x06\xbe\x01\0\xc7\x01\x01\n\x0b\n\ - \x03\x04\x0e\x01\x12\x04\xbe\x01\x08\x17\n\x0b\n\x03\x04\x0e\x07\x12\x04\ - \xbf\x01\x02.\n\x0f\n\x07\x04\x0e\x07\xf1\x8c\xa6\x05\x12\x04\xbf\x01\ - \x02.\n\x0b\n\x03\x04\x0e\x07\x12\x04\xc0\x01\x02.\n\x10\n\x08\x04\x0e\ - \x07\xf0\x8c\xa6\x05\0\x12\x04\xc0\x01\x02.\nC\n\x04\x04\x0e\x02\0\x12\ - \x04\xc3\x01\x02J\x1a5\x20Authority\x20is\x20the\x20address\x20of\x20the\ - \x20governance\x20account.\n\n\r\n\x05\x04\x0e\x02\0\x05\x12\x04\xc3\x01\ - \x02\x08\n\r\n\x05\x04\x0e\x02\0\x01\x12\x04\xc3\x01\t\x12\n\r\n\x05\x04\ - \x0e\x02\0\x03\x12\x04\xc3\x01\x15\x16\n\r\n\x05\x04\x0e\x02\0\x08\x12\ - \x04\xc3\x01\x17I\n\x10\n\x08\x04\x0e\x02\0\x08\xca\xd6\x05\x12\x04\xc3\ - \x01\x19G\n8\n\x04\x04\x0e\x02\x01\x12\x06\xc5\x01\x02\xc6\x01D\x1a(\x20\ - NOTE:\x20All\x20parameters\x20must\x20be\x20supplied.\n\n\r\n\x05\x04\ - \x0e\x02\x01\x06\x12\x04\xc5\x01\x02\x08\n\r\n\x05\x04\x0e\x02\x01\x01\ - \x12\x04\xc5\x01\t\x0f\n\r\n\x05\x04\x0e\x02\x01\x03\x12\x04\xc5\x01\x12\ - \x13\n\r\n\x05\x04\x0e\x02\x01\x08\x12\x04\xc6\x01\x04C\n\x10\n\x08\x04\ - \x0e\x02\x01\x08\xe9\xfb\x03\x12\x04\xc6\x01\x06\"\n\x11\n\t\x04\x0e\x02\ - \x01\x08\xf5\x8c\xa6\x05\x12\x04\xc6\x01$A\n|\n\x02\x04\x0f\x12\x04\xcd\ - \x01\0\"\x1ap\x20MsgUpdateParamsResponse\x20defines\x20the\x20response\ - \x20structure\x20for\x20executing\x20a\n\x20MsgUpdateParams\x20message.\ - \n\n\x20Since:\x200.47\n\n\x0b\n\x03\x04\x0f\x01\x12\x04\xcd\x01\x08\x1f\ - b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(7); - deps.push(super::gogo::file_descriptor().clone()); - deps.push(super::coin::file_descriptor().clone()); - deps.push(::protobuf::well_known_types::timestamp::file_descriptor().clone()); - deps.push(super::amino::file_descriptor().clone()); - deps.push(super::params::file_descriptor().clone()); - deps.push(super::msg::file_descriptor().clone()); - deps.push(super::cosmos::file_descriptor().clone()); - let mut messages = ::std::vec::Vec::with_capacity(16); - messages.push(DepositOptions::generated_message_descriptor_data()); - messages.push(MsgDeposit::generated_message_descriptor_data()); - messages.push(MsgDepositResponse::generated_message_descriptor_data()); - messages.push(MsgWithdrawal::generated_message_descriptor_data()); - messages.push(MsgWithdrawalResponse::generated_message_descriptor_data()); - messages.push(MsgPlaceLimitOrder::generated_message_descriptor_data()); - messages.push(MsgPlaceLimitOrderResponse::generated_message_descriptor_data()); - messages.push(MsgWithdrawFilledLimitOrder::generated_message_descriptor_data()); - messages.push(MsgWithdrawFilledLimitOrderResponse::generated_message_descriptor_data()); - messages.push(MsgCancelLimitOrder::generated_message_descriptor_data()); - messages.push(MsgCancelLimitOrderResponse::generated_message_descriptor_data()); - messages.push(MultiHopRoute::generated_message_descriptor_data()); - messages.push(MsgMultiHopSwap::generated_message_descriptor_data()); - messages.push(MsgMultiHopSwapResponse::generated_message_descriptor_data()); - messages.push(MsgUpdateParams::generated_message_descriptor_data()); - messages.push(MsgUpdateParamsResponse::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(1); - enums.push(LimitOrderType::generated_enum_descriptor_data()); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml new file mode 100644 index 00000000..4f97ead2 --- /dev/null +++ b/proto-build/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "proto-build" +version = "0.1.0" +authors = ["Justin Kilpatrick ", "Tony Arcieri "] +edition = "2018" +publish = false + +[dependencies] +prost = "0.12" +prost-build = "0.12" +tonic = "0.10" +tonic-build = "0.10" +regex = "1" +walkdir = "2" diff --git a/proto-build/buf.neutron.gen.yaml b/proto-build/buf.neutron.gen.yaml new file mode 100644 index 00000000..17b5bb6e --- /dev/null +++ b/proto-build/buf.neutron.gen.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - plugin: buf.build/community/neoeinstein-prost:v0.2.1 + out: . + - plugin: buf.build/community/neoeinstein-tonic:v0.3.0 + out: . + opt: + - no_server=true diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs new file mode 100644 index 00000000..d7fabf40 --- /dev/null +++ b/proto-build/src/main.rs @@ -0,0 +1,315 @@ +//! Build CosmosSDK/Tendermint/IBC proto files. This build script clones the CosmosSDK version +//! specified in the COSMOS_SDK_REV constant and then uses that to build the required +//! proto files for further compilation. This is based on the proto-compiler code +//! in github.com/informalsystems/ibc-rs + +use regex::Regex; +use std::{ + env, + ffi::{OsStr, OsString}, + fs::{self, create_dir_all, remove_dir_all}, + io, + path::{Path, PathBuf}, + process, + sync::atomic::{self, AtomicBool}, +}; +use walkdir::WalkDir; + +/// Suppress log messages +// TODO(tarcieri): use a logger for this +static QUIET: AtomicBool = AtomicBool::new(false); + +// All paths must end with a / and either be absolute or include a ./ to reference the current +// working directory. + +const COSMOS_SDK_PROTO_DIR: &str = "../packages/neutron-sdk/src/proto_types"; + +/// The directory generated cosmos-sdk proto files go into in this repo +const TMP_BUILD_DIR: &str = "/tmp/tmp-protobuf/"; + +const NEUTRON_DIR: &str = "../neutron"; +const NEUTRON_REV: &str = "83770b74d18b5f5e90c7b0514c7e13a0558af30a"; // merge_duality_neutron; + +// Patch strings used by `copy_and_patch` + +/// Protos belonging to these Protobuf packages will be excluded +/// (i.e. because they are sourced from `tendermint-proto`) +const EXCLUDED_PROTO_PACKAGES: &[&str] = &["gogoproto", "google", "tendermint"]; + +/// Log info to the console (if `QUIET` is disabled) +// TODO(tarcieri): use a logger for this +macro_rules! info { + ($msg:expr) => { + if !is_quiet() { + println!("[info] {}", $msg) + } + }; + ($fmt:expr, $($arg:tt)+) => { + info!(&format!($fmt, $($arg)+)) + }; +} + +fn main() { + if is_github() { + set_quiet(); + } + + let tmp_build_dir: PathBuf = TMP_BUILD_DIR.parse().unwrap(); + let proto_dir: PathBuf = COSMOS_SDK_PROTO_DIR.parse().unwrap(); + + if tmp_build_dir.exists() { + fs::remove_dir_all(tmp_build_dir.clone()).unwrap(); + } + + let temp_neutron_dir = tmp_build_dir.join("neutron"); + + fs::create_dir_all(&temp_neutron_dir).unwrap(); + + update_submodules(); + output_neutron_version(&temp_neutron_dir); + compile_neutron_proto_and_services(&temp_neutron_dir); + + copy_generated_files(&temp_neutron_dir, &proto_dir.join("dex")); + + // apply_patches(&proto_dir); + + info!("Running rustfmt on prost/tonic-generated code"); + run_rustfmt(&proto_dir); + + if is_github() { + println!( + "Rebuild protos with proto-build (neutron-rev: {}))", + NEUTRON_REV + ); + } +} + +fn is_quiet() -> bool { + QUIET.load(atomic::Ordering::Relaxed) +} + +fn set_quiet() { + QUIET.store(true, atomic::Ordering::Relaxed); +} + +/// Parse `--github` flag passed to `proto-build` on the eponymous GitHub Actions job. +/// Disables `info`-level log messages, instead outputting only a commit message. +fn is_github() -> bool { + env::args().any(|arg| arg == "--github") +} + +fn run_cmd(cmd: impl AsRef, args: impl IntoIterator>) { + let stdout = if is_quiet() { + process::Stdio::null() + } else { + process::Stdio::inherit() + }; + + let exit_status = process::Command::new(&cmd) + .args(args) + .stdout(stdout) + .status() + .unwrap_or_else(|e| match e.kind() { + io::ErrorKind::NotFound => panic!( + "error running '{:?}': command not found. Is it installed?", + cmd.as_ref() + ), + _ => panic!("error running '{:?}': {:?}", cmd.as_ref(), e), + }); + + if !exit_status.success() { + match exit_status.code() { + Some(code) => panic!("{:?} exited with error code: {:?}", cmd.as_ref(), code), + None => panic!("{:?} exited without error code", cmd.as_ref()), + } + } +} + +fn run_buf(config: &str, proto_path: impl AsRef, out_dir: impl AsRef) { + run_cmd( + "buf", + [ + "generate", + "--template", + config, + "--include-imports", + "-o", + &out_dir.as_ref().display().to_string(), + &proto_path.as_ref().display().to_string(), + ], + ); +} + +fn run_git(args: impl IntoIterator>) { + run_cmd("git", args) +} + +fn run_rustfmt(dir: &Path) { + let mut args = ["--edition", "2021"] + .iter() + .map(Into::into) + .collect::>(); + + args.extend( + WalkDir::new(dir) + .into_iter() + .filter_map(|e| e.ok()) + .filter(|e| e.file_type().is_file() && e.path().extension() == Some(OsStr::new("rs"))) + .map(|e| e.into_path()) + .map(Into::into), + ); + + run_cmd("rustfmt", args); +} + +fn update_submodules() { + info!("Updating neutron submodule..."); + run_git(["submodule", "update", "--init"]); + run_git(["-C", NEUTRON_DIR, "fetch"]); + run_git(["-C", NEUTRON_DIR, "reset", "--hard", NEUTRON_REV]); +} + +fn output_neutron_version(out_dir: &Path) { + let path = out_dir.join("NEUTRON_COMMIT"); + fs::write(path, NEUTRON_REV).unwrap(); +} + +fn compile_neutron_proto_and_services(out_dir: &Path) { + let sdk_dir = Path::new(NEUTRON_DIR); + let proto_path = sdk_dir.join("proto"); + let proto_paths = [ + // format!("{}/third_party/proto/ibc", sdk_dir.display()), + format!("{}/proto/neutron/dex", sdk_dir.display()), + ]; + + // List available proto files + let mut protos: Vec = vec![]; + collect_protos(&proto_paths, &mut protos); + + // Compile all proto client for GRPC services + info!("Compiling neutron proto clients for GRPC services!"); + run_buf("buf.neutron.gen.yaml", proto_path, out_dir); + info!("=> Done!"); +} + +/// collect_protos walks every path in `proto_paths` and recursively locates all .proto +/// files in each path's subdirectories, adding the full path of each file to `protos` +/// +/// Any errors encountered will cause failure for the path provided to WalkDir::new() +fn collect_protos(proto_paths: &[String], protos: &mut Vec) { + for proto_path in proto_paths { + protos.append( + &mut WalkDir::new(proto_path) + .into_iter() + .filter_map(|e| e.ok()) + .filter(|e| { + e.file_type().is_file() + && e.path().extension().is_some() + && e.path().extension().unwrap() == "proto" + }) + .map(|e| e.into_path()) + .collect(), + ); + } +} + +fn copy_generated_files(from_dir: &Path, to_dir: &Path) { + info!("Copying generated files into '{}'...", to_dir.display()); + + // Remove old compiled files + remove_dir_all(to_dir).unwrap_or_default(); + create_dir_all(to_dir).unwrap(); + + let mut filenames = Vec::new(); + + // Copy new compiled files (prost does not use folder structures) + let errors = WalkDir::new(from_dir) + .into_iter() + .filter_map(|e| e.ok()) + .filter(|e| e.file_type().is_file()) + .map(|e| { + let filename = e.file_name().to_os_string().to_str().unwrap().to_string(); + filenames.push(filename.clone()); + copy_and_patch(e.path(), format!("{}/{}", to_dir.display(), &filename)) + }) + .filter_map(|e| e.err()) + .collect::>(); + + if !errors.is_empty() { + for e in errors { + eprintln!("[error] Error while copying compiled file: {}", e); + } + + panic!("[error] Aborted."); + } +} + +fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<()> { + /// Regex substitutions to apply to the prost-generated output + const REPLACEMENTS: &[(&str, &str)] = &[ + // Use `tendermint-proto` proto definitions + ("(super::)+tendermint", "tendermint_proto"), + // Feature-gate gRPC client modules + ( + "/// Generated client implementations.", + "/// Generated client implementations.\n\ + #[cfg(feature = \"grpc\")]", + ), + // Feature-gate gRPC impls which use `tonic::transport` + ( + "impl(.+)tonic::transport(.+)", + "#[cfg(feature = \"grpc-transport\")]\n \ + impl${1}tonic::transport${2}", + ), + // Feature-gate gRPC server modules + ( + "/// Generated server implementations.", + "/// Generated server implementations.\n\ + #[cfg(feature = \"grpc\")]", + ), + ]; + + // Skip proto files belonging to `EXCLUDED_PROTO_PACKAGES` + for package in EXCLUDED_PROTO_PACKAGES { + if let Some(filename) = src.as_ref().file_name().and_then(OsStr::to_str) { + if filename.starts_with(&format!("{}.", package)) { + return Ok(()); + } + } + } + + let mut contents = fs::read_to_string(src)?; + + for &(regex, replacement) in REPLACEMENTS { + contents = Regex::new(regex) + .unwrap_or_else(|_| panic!("invalid regex: {}", regex)) + .replace_all(&contents, replacement) + .to_string(); + } + + fs::write(dest, &contents) +} + +// fn patch_file(path: impl AsRef, pattern: &Regex, replacement: &str) -> io::Result<()> { +// let mut contents = fs::read_to_string(&path)?; +// contents = pattern.replace_all(&contents, replacement).to_string(); +// fs::write(path, &contents) +// } + +// Fix clashing type names in prost-generated code. See cosmos/cosmos-rust#154. +// fn apply_patches(proto_dir: &Path) { +// for (pattern, replacement) in [ +// ("enum Validators", "enum Policy"), +// ( +// "stake_authorization::Validators", +// "stake_authorization::Policy", +// ), +// ] { +// patch_file( +// &proto_dir.join("cosmos-sdk/cosmos.staking.v1beta1.rs"), +// &Regex::new(pattern).unwrap(), +// replacement, +// ) +// .expect("error patching cosmos.staking.v1beta1.rs"); +// } +// } diff --git a/proto/amino.proto b/proto/amino.proto deleted file mode 100644 index e1cc6929..00000000 --- a/proto/amino.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; - -package amino; - -import "google/protobuf/descriptor.proto"; - -// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. -// We need this right now because gogoproto codegen needs to import the extension. -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; - -extend google.protobuf.MessageOptions { - // name is the string used when registering a concrete - // type into the Amino type registry, via the Amino codec's - // `RegisterConcrete()` method. This string MUST be at most 39 - // characters long, or else the message will be rejected by the - // Ledger hardware device. - string name = 11110001; - - // encoding describes the encoding format used by Amino for the given - // message. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the `encoding` - // one which operates on the field level. - string message_encoding = 11110002; -} - -extend google.protobuf.FieldOptions { - // encoding describes the encoding format used by Amino for - // the given field. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the - // `message_encoding` one which operates on the message level. - string encoding = 11110003; - - // field_name sets a different field name (i.e. key name) in - // the amino JSON object for the given field. - // - // Example: - // - // message Foo { - // string bar = 1 [(amino.field_name) = "baz"]; - // } - // - // Then the Amino encoding of Foo will be: - // `{"baz":"some value"}` - string field_name = 11110004; - - // dont_omitempty sets the field in the JSON object even if - // its value is empty, i.e. equal to the Golang zero value. To learn what - // the zero values are, see https://go.dev/ref/spec#The_zero_value. - // - // Fields default to `omitempty`, which is the default behavior when this - // annotation is unset. When set to true, then the field value in the - // JSON object will be set, i.e. not `undefined`. - // - // Example: - // - // message Foo { - // string bar = 1; - // string baz = 2 [(amino.dont_omitempty) = true]; - // } - // - // f := Foo{}; - // out := AminoJSONEncoder(&f); - // out == {"baz":""} - bool dont_omitempty = 11110005; -} diff --git a/proto/amino/amino.proto b/proto/amino/amino.proto deleted file mode 100644 index e1cc6929..00000000 --- a/proto/amino/amino.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; - -package amino; - -import "google/protobuf/descriptor.proto"; - -// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. -// We need this right now because gogoproto codegen needs to import the extension. -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; - -extend google.protobuf.MessageOptions { - // name is the string used when registering a concrete - // type into the Amino type registry, via the Amino codec's - // `RegisterConcrete()` method. This string MUST be at most 39 - // characters long, or else the message will be rejected by the - // Ledger hardware device. - string name = 11110001; - - // encoding describes the encoding format used by Amino for the given - // message. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the `encoding` - // one which operates on the field level. - string message_encoding = 11110002; -} - -extend google.protobuf.FieldOptions { - // encoding describes the encoding format used by Amino for - // the given field. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the - // `message_encoding` one which operates on the message level. - string encoding = 11110003; - - // field_name sets a different field name (i.e. key name) in - // the amino JSON object for the given field. - // - // Example: - // - // message Foo { - // string bar = 1 [(amino.field_name) = "baz"]; - // } - // - // Then the Amino encoding of Foo will be: - // `{"baz":"some value"}` - string field_name = 11110004; - - // dont_omitempty sets the field in the JSON object even if - // its value is empty, i.e. equal to the Golang zero value. To learn what - // the zero values are, see https://go.dev/ref/spec#The_zero_value. - // - // Fields default to `omitempty`, which is the default behavior when this - // annotation is unset. When set to true, then the field value in the - // JSON object will be set, i.e. not `undefined`. - // - // Example: - // - // message Foo { - // string bar = 1; - // string baz = 2 [(amino.dont_omitempty) = true]; - // } - // - // f := Foo{}; - // out := AminoJSONEncoder(&f); - // out == {"baz":""} - bool dont_omitempty = 11110005; -} diff --git a/proto/cosmos/app/runtime/v1alpha1/module.proto b/proto/cosmos/app/runtime/v1alpha1/module.proto deleted file mode 100644 index 4598ba44..00000000 --- a/proto/cosmos/app/runtime/v1alpha1/module.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.runtime.v1alpha1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object for the runtime module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/runtime" - use_package: {name: "cosmos.app.v1alpha1"} - }; - - // app_name is the name of the app. - string app_name = 1; - - // begin_blockers specifies the module names of begin blockers - // to call in the order in which they should be called. If this is left empty - // no begin blocker will be registered. - repeated string begin_blockers = 2; - - // end_blockers specifies the module names of the end blockers - // to call in the order in which they should be called. If this is left empty - // no end blocker will be registered. - repeated string end_blockers = 3; - - // init_genesis specifies the module names of init genesis functions - // to call in the order in which they should be called. If this is left empty - // no init genesis function will be registered. - repeated string init_genesis = 4; - - // export_genesis specifies the order in which to export module genesis data. - // If this is left empty, the init_genesis order will be used for export genesis - // if it is specified. - repeated string export_genesis = 5; - - // override_store_keys is an optional list of overrides for the module store keys - // to be used in keeper construction. - repeated StoreKeyConfig override_store_keys = 6; -} - -// StoreKeyConfig may be supplied to override the default module store key, which -// is the module name. -message StoreKeyConfig { - // name of the module to override the store key of - string module_name = 1; - - // the kv store key to use instead of the module name. - string kv_store_key = 2; -} diff --git a/proto/cosmos/app/v1alpha1/config.proto b/proto/cosmos/app/v1alpha1/config.proto deleted file mode 100644 index ee3e7065..00000000 --- a/proto/cosmos/app/v1alpha1/config.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "google/protobuf/any.proto"; - -// Config represents the configuration for a Cosmos SDK ABCI app. -// It is intended that all state machine logic including the version of -// baseapp and tx handlers (and possibly even Tendermint) that an app needs -// can be described in a config object. For compatibility, the framework should -// allow a mixture of declarative and imperative app wiring, however, apps -// that strive for the maximum ease of maintainability should be able to describe -// their state machine with a config object alone. -message Config { - // modules are the module configurations for the app. - repeated ModuleConfig modules = 1; - - // golang_bindings specifies explicit interface to implementation type bindings which - // depinject uses to resolve interface inputs to provider functions. The scope of this - // field's configuration is global (not module specific). - repeated GolangBinding golang_bindings = 2; -} - -// ModuleConfig is a module configuration for an app. -message ModuleConfig { - // name is the unique name of the module within the app. It should be a name - // that persists between different versions of a module so that modules - // can be smoothly upgraded to new versions. - // - // For example, for the module cosmos.bank.module.v1.Module, we may chose - // to simply name the module "bank" in the app. When we upgrade to - // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same - // and the framework knows that the v2 module should receive all the same state - // that the v1 module had. Note: modules should provide info on which versions - // they can migrate from in the ModuleDescriptor.can_migration_from field. - string name = 1; - - // config is the config object for the module. Module config messages should - // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. - google.protobuf.Any config = 2; - - // golang_bindings specifies explicit interface to implementation type bindings which - // depinject uses to resolve interface inputs to provider functions. The scope of this - // field's configuration is module specific. - repeated GolangBinding golang_bindings = 3; -} - -// GolangBinding is an explicit interface type to implementing type binding for dependency injection. -message GolangBinding { - // interface_type is the interface type which will be bound to a specific implementation type - string interface_type = 1; - - // implementation is the implementing type which will be supplied when an input of type interface is requested - string implementation = 2; -} \ No newline at end of file diff --git a/proto/cosmos/app/v1alpha1/module.proto b/proto/cosmos/app/v1alpha1/module.proto deleted file mode 100644 index 99085717..00000000 --- a/proto/cosmos/app/v1alpha1/module.proto +++ /dev/null @@ -1,91 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - // module indicates that this proto type is a config object for an app module - // and optionally provides other descriptive information about the module. - // It is recommended that a new module config object and go module is versioned - // for every state machine breaking version of a module. The recommended - // pattern for doing this is to put module config objects in a separate proto - // package from the API they expose. Ex: the cosmos.group.v1 API would be - // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. - ModuleDescriptor module = 57193479; -} - -// ModuleDescriptor describes an app module. -message ModuleDescriptor { - // go_import names the package that should be imported by an app to load the - // module in the runtime module registry. It is required to make debugging - // of configuration errors easier for users. - string go_import = 1; - - // use_package refers to a protobuf package that this module - // uses and exposes to the world. In an app, only one module should "use" - // or own a single protobuf package. It is assumed that the module uses - // all of the .proto files in a single package. - repeated PackageReference use_package = 2; - - // can_migrate_from defines which module versions this module can migrate - // state from. The framework will check that one module version is able to - // migrate from a previous module version before attempting to update its - // config. It is assumed that modules can transitively migrate from earlier - // versions. For instance if v3 declares it can migrate from v2, and v2 - // declares it can migrate from v1, the framework knows how to migrate - // from v1 to v3, assuming all 3 module versions are registered at runtime. - repeated MigrateFromInfo can_migrate_from = 3; -} - -// PackageReference is a reference to a protobuf package used by a module. -message PackageReference { - // name is the fully-qualified name of the package. - string name = 1; - - // revision is the optional revision of the package that is being used. - // Protobuf packages used in Cosmos should generally have a major version - // as the last part of the package name, ex. foo.bar.baz.v1. - // The revision of a package can be thought of as the minor version of a - // package which has additional backwards compatible definitions that weren't - // present in a previous version. - // - // A package should indicate its revision with a source code comment - // above the package declaration in one of its files containing the - // text "Revision N" where N is an integer revision. All packages start - // at revision 0 the first time they are released in a module. - // - // When a new version of a module is released and items are added to existing - // .proto files, these definitions should contain comments of the form - // "Since Revision N" where N is an integer revision. - // - // When the module runtime starts up, it will check the pinned proto - // image and panic if there are runtime protobuf definitions that are not - // in the pinned descriptor which do not have - // a "Since Revision N" comment or have a "Since Revision N" comment where - // N is <= to the revision specified here. This indicates that the protobuf - // files have been updated, but the pinned file descriptor hasn't. - // - // If there are items in the pinned file descriptor with a revision - // greater than the value indicated here, this will also cause a panic - // as it may mean that the pinned descriptor for a legacy module has been - // improperly updated or that there is some other versioning discrepancy. - // Runtime protobuf definitions will also be checked for compatibility - // with pinned file descriptors to make sure there are no incompatible changes. - // - // This behavior ensures that: - // * pinned proto images are up-to-date - // * protobuf files are carefully annotated with revision comments which - // are important good client UX - // * protobuf files are changed in backwards and forwards compatible ways - uint32 revision = 2; -} - -// MigrateFromInfo is information on a module version that a newer module -// can migrate from. -message MigrateFromInfo { - - // module is the fully-qualified protobuf name of the module config object - // for the previous module version, ex: "cosmos.group.module.v1.Module". - string module = 1; -} diff --git a/proto/cosmos/app/v1alpha1/query.proto b/proto/cosmos/app/v1alpha1/query.proto deleted file mode 100644 index efec9c81..00000000 --- a/proto/cosmos/app/v1alpha1/query.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "cosmos/app/v1alpha1/config.proto"; - -// Query is the app module query service. -service Query { - - // Config returns the current app config. - rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} -} - -// QueryConfigRequest is the Query/Config request type. -message QueryConfigRequest {} - -// QueryConfigRequest is the Query/Config response type. -message QueryConfigResponse { - - // config is the current app config. - Config config = 1; -} diff --git a/proto/cosmos/auth/module/v1/module.proto b/proto/cosmos/auth/module/v1/module.proto deleted file mode 100644 index dbe46a15..00000000 --- a/proto/cosmos/auth/module/v1/module.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package cosmos.auth.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object for the auth module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/auth" - }; - - // bech32_prefix is the bech32 account prefix for the app. - string bech32_prefix = 1; - - // module_account_permissions are module account permissions. - repeated ModuleAccountPermission module_account_permissions = 2; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 3; -} - -// ModuleAccountPermission represents permissions for a module account. -message ModuleAccountPermission { - // account is the name of the module. - string account = 1; - - // permissions are the permissions this module has. Currently recognized - // values are minter, burner and staking. - repeated string permissions = 2; -} diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto deleted file mode 100644 index 0578453c..00000000 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "amino/amino.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// BaseAccount defines a base account type. It contains all the necessary fields -// for basic account functionality. Any custom account type should extend this -// type for additional functionality (e.g. vesting). -message BaseAccount { - option (amino.name) = "cosmos-sdk/BaseAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; - uint64 account_number = 3; - uint64 sequence = 4; -} - -// ModuleAccount defines an account for modules that holds coins on a pool. -message ModuleAccount { - option (amino.name) = "cosmos-sdk/ModuleAccount"; - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; - - BaseAccount base_account = 1 [(gogoproto.embed) = true]; - string name = 2; - repeated string permissions = 3; -} - -// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. -// -// Since: cosmos-sdk 0.47 -message ModuleCredential { - // module_name is the name of the module used for address derivation (passed into address.Module). - string module_name = 1; - // derivation_keys is for deriving a module account address (passed into address.Module) - // adding more keys creates sub-account addresses (passed into address.Derive) - repeated bytes derivation_keys = 2; -} - -// Params defines the parameters for the auth module. -message Params { - option (amino.name) = "cosmos-sdk/x/auth/Params"; - option (gogoproto.equal) = true; - - uint64 max_memo_characters = 1; - uint64 tx_sig_limit = 2; - uint64 tx_size_cost_per_byte = 3; - uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; - uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; -} diff --git a/proto/cosmos/auth/v1beta1/genesis.proto b/proto/cosmos/auth/v1beta1/genesis.proto deleted file mode 100644 index d1aa66e4..00000000 --- a/proto/cosmos/auth/v1beta1/genesis.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// GenesisState defines the auth module's genesis state. -message GenesisState { - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // accounts are the accounts present at genesis. - repeated google.protobuf.Any accounts = 2; -} diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto deleted file mode 100644 index 804f2ff0..00000000 --- a/proto/cosmos/auth/v1beta1/query.proto +++ /dev/null @@ -1,236 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/query/v1/query.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// Query defines the gRPC querier service. -service Query { - // Accounts returns all the existing accounts. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.43 - rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; - } - - // Account returns account details based on address. - rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; - } - - // AccountAddressByID returns account address based on account number. - // - // Since: cosmos-sdk 0.46.2 - rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; - } - - // Params queries all parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/params"; - } - - // ModuleAccounts returns all the existing module accounts. - // - // Since: cosmos-sdk 0.46 - rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; - } - - // ModuleAccountByName returns the module account info by module name - rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; - } - - // Bech32Prefix queries bech32Prefix - // - // Since: cosmos-sdk 0.46 - rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; - } - - // AddressBytesToString converts Account Address bytes to string - // - // Since: cosmos-sdk 0.46 - rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; - } - - // AddressStringToBytes converts Address string to bytes - // - // Since: cosmos-sdk 0.46 - rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; - } - - // AccountInfo queries account info which is common to all account types. - // - // Since: cosmos-sdk 0.47 - rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}"; - } -} - -// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsResponse { - // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAccountRequest is the request type for the Query/Account RPC method. -message QueryAccountRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address defines the address to query for. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryAccountResponse is the response type for the Query/Account RPC method. -message QueryAccountResponse { - // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. -// -// Since: cosmos-sdk 0.46 -message QueryModuleAccountsRequest {} - -// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. -// -// Since: cosmos-sdk 0.46 -message QueryModuleAccountsResponse { - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; -} - -// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. -message QueryModuleAccountByNameRequest { - string name = 1; -} - -// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. -message QueryModuleAccountByNameResponse { - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; -} - -// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. -// -// Since: cosmos-sdk 0.46 -message Bech32PrefixRequest {} - -// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. -// -// Since: cosmos-sdk 0.46 -message Bech32PrefixResponse { - string bech32_prefix = 1; -} - -// AddressBytesToStringRequest is the request type for AddressString rpc method. -// -// Since: cosmos-sdk 0.46 -message AddressBytesToStringRequest { - bytes address_bytes = 1; -} - -// AddressBytesToStringResponse is the response type for AddressString rpc method. -// -// Since: cosmos-sdk 0.46 -message AddressBytesToStringResponse { - string address_string = 1; -} - -// AddressStringToBytesRequest is the request type for AccountBytes rpc method. -// -// Since: cosmos-sdk 0.46 -message AddressStringToBytesRequest { - string address_string = 1; -} - -// AddressStringToBytesResponse is the response type for AddressBytes rpc method. -// -// Since: cosmos-sdk 0.46 -message AddressStringToBytesResponse { - bytes address_bytes = 1; -} - -// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method -// -// Since: cosmos-sdk 0.46.2 -message QueryAccountAddressByIDRequest { - // Deprecated, use account_id instead - // - // id is the account number of the address to be queried. This field - // should have been an uint64 (like all account numbers), and will be - // updated to uint64 in a future version of the auth query. - int64 id = 1 [deprecated = true]; - - // account_id is the account number of the address to be queried. - // - // Since: cosmos-sdk 0.47 - uint64 account_id = 2; -} - -// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method -// -// Since: cosmos-sdk 0.46.2 -message QueryAccountAddressByIDResponse { - string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryAccountInfoRequest is the Query/AccountInfo request type. -// -// Since: cosmos-sdk 0.47 -message QueryAccountInfoRequest { - - // address is the account address string. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryAccountInfoResponse is the Query/AccountInfo response type. -// -// Since: cosmos-sdk 0.47 -message QueryAccountInfoResponse { - - // info is the account info which is represented by BaseAccount. - BaseAccount info = 1; -} diff --git a/proto/cosmos/auth/v1beta1/tx.proto b/proto/cosmos/auth/v1beta1/tx.proto deleted file mode 100644 index 1edee037..00000000 --- a/proto/cosmos/auth/v1beta1/tx.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// Msg defines the x/auth Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // UpdateParams defines a (governance) operation for updating the x/auth module - // parameters. The authority defaults to the x/gov module account. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/auth/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/auth parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/authz/module/v1/module.proto b/proto/cosmos/authz/module/v1/module.proto deleted file mode 100644 index 80058668..00000000 --- a/proto/cosmos/authz/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.authz.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the authz module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/authz" - }; -} diff --git a/proto/cosmos/authz/v1beta1/authz.proto b/proto/cosmos/authz/v1beta1/authz.proto deleted file mode 100644 index 3fee7364..00000000 --- a/proto/cosmos/authz/v1beta1/authz.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "amino/amino.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// GenericAuthorization gives the grantee unrestricted permissions to execute -// the provided method on behalf of the granter's account. -message GenericAuthorization { - option (amino.name) = "cosmos-sdk/GenericAuthorization"; - option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; - - // Msg, identified by it's type URL, to grant unrestricted permissions to execute - string msg = 1; -} - -// Grant gives permissions to execute -// the provide method with expiration time. -message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; - // time when the grant will expire and will be pruned. If null, then the grant - // doesn't have a time expiration (other conditions in `authorization` - // may apply to invalidate the grant) - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; -} - -// GrantAuthorization extends a grant with both the addresses of the grantee and granter. -// It is used in genesis.proto and query.proto -message GrantAuthorization { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; - google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; -} - -// GrantQueueItem contains the list of TypeURL of a sdk.Msg. -message GrantQueueItem { - // msg_type_urls contains the list of TypeURL of a sdk.Msg. - repeated string msg_type_urls = 1; -} diff --git a/proto/cosmos/authz/v1beta1/event.proto b/proto/cosmos/authz/v1beta1/event.proto deleted file mode 100644 index 0476649a..00000000 --- a/proto/cosmos/authz/v1beta1/event.proto +++ /dev/null @@ -1,27 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// EventGrant is emitted on Msg/Grant -message EventGrant { - // Msg type URL for which an autorization is granted - string msg_type_url = 2; - // Granter account address - string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Grantee account address - string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// EventRevoke is emitted on Msg/Revoke -message EventRevoke { - // Msg type URL for which an autorization is revoked - string msg_type_url = 2; - // Granter account address - string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Grantee account address - string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} diff --git a/proto/cosmos/authz/v1beta1/genesis.proto b/proto/cosmos/authz/v1beta1/genesis.proto deleted file mode 100644 index 9fefff45..00000000 --- a/proto/cosmos/authz/v1beta1/genesis.proto +++ /dev/null @@ -1,14 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/authz/v1beta1/authz.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// GenesisState defines the authz module's genesis state. -message GenesisState { - repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/authz/v1beta1/query.proto b/proto/cosmos/authz/v1beta1/query.proto deleted file mode 100644 index 62154ac1..00000000 --- a/proto/cosmos/authz/v1beta1/query.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/authz/v1beta1/authz.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// Query defines the gRPC querier service. -service Query { - // Returns list of `Authorization`, granted to the grantee by the granter. - rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; - } - - // GranterGrants returns list of `GrantAuthorization`, granted by granter. - // - // Since: cosmos-sdk 0.46 - rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; - } - - // GranteeGrants returns a list of `GrantAuthorization` by grantee. - // - // Since: cosmos-sdk 0.46 - rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; - } -} - -// QueryGrantsRequest is the request type for the Query/Grants RPC method. -message QueryGrantsRequest { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Optional, msg_type_url, when set, will query only grants matching given msg type. - string msg_type_url = 3; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. -message QueryGrantsResponse { - // authorizations is a list of grants granted for grantee by granter. - repeated Grant grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. -message QueryGranterGrantsRequest { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. -message QueryGranterGrantsResponse { - // grants is a list of grants granted by the granter. - repeated GrantAuthorization grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. -message QueryGranteeGrantsRequest { - string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. -message QueryGranteeGrantsResponse { - // grants is a list of grants granted to the grantee. - repeated GrantAuthorization grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto deleted file mode 100644 index 69277c95..00000000 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/authz/v1beta1/authz.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the authz Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // Grant grants the provided authorization to the grantee on the granter's - // account with the provided expiration time. If there is already a grant - // for the given (granter, grantee, Authorization) triple, then the grant - // will be overwritten. - rpc Grant(MsgGrant) returns (MsgGrantResponse); - - // Exec attempts to execute the provided messages using - // authorizations granted to the grantee. Each message should have only - // one signer corresponding to the granter of the authorization. - rpc Exec(MsgExec) returns (MsgExecResponse); - - // Revoke revokes any authorization corresponding to the provided method name on the - // granter's account that has been granted to the grantee. - rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); -} - -// MsgGrant is a request type for Grant method. It declares authorization to the grantee -// on behalf of the granter with the provided expiration time. -message MsgGrant { - option (cosmos.msg.v1.signer) = "granter"; - option (amino.name) = "cosmos-sdk/MsgGrant"; - - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgExecResponse defines the Msg/MsgExecResponse response type. -message MsgExecResponse { - repeated bytes results = 1; -} - -// MsgExec attempts to execute the provided messages using -// authorizations granted to the grantee. Each message should have only -// one signer corresponding to the granter of the authorization. -message MsgExec { - option (cosmos.msg.v1.signer) = "grantee"; - option (amino.name) = "cosmos-sdk/MsgExec"; - - string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Execute Msg. - // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - // triple and validate it. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; -} - -// MsgGrantResponse defines the Msg/MsgGrant response type. -message MsgGrantResponse {} - -// MsgRevoke revokes any authorization with the provided sdk.Msg type on the -// granter's account with that has been granted to the grantee. -message MsgRevoke { - option (cosmos.msg.v1.signer) = "granter"; - option (amino.name) = "cosmos-sdk/MsgRevoke"; - - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string msg_type_url = 3; -} - -// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. -message MsgRevokeResponse {} diff --git a/proto/cosmos/autocli/v1/options.proto b/proto/cosmos/autocli/v1/options.proto deleted file mode 100644 index 55877512..00000000 --- a/proto/cosmos/autocli/v1/options.proto +++ /dev/null @@ -1,127 +0,0 @@ -syntax = "proto3"; - -package cosmos.autocli.v1; - -option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; - -// ModuleOptions describes the CLI options for a Cosmos SDK module. -message ModuleOptions { - // tx describes the tx command for the module. - ServiceCommandDescriptor tx = 1; - - // query describes the tx command for the module. - ServiceCommandDescriptor query = 2; -} - -// ServiceCommandDescriptor describes a CLI command based on a protobuf service. -message ServiceCommandDescriptor { - - // service is the fully qualified name of the protobuf service to build - // the command from. It can be left empty if sub_commands are used instead - // which may be the case if a module provides multiple tx and/or query services. - string service = 1; - - // rpc_command_options are options for commands generated from rpc methods. - // If no options are specified for a given rpc method on the service, a - // command will be generated for that method with the default options. - repeated RpcCommandOptions rpc_command_options = 2; - - // sub_commands is a map of optional sub-commands for this command based on - // different protobuf services. The map key is used as the name of the - // sub-command. - map sub_commands = 3; -} - -// RpcCommandOptions specifies options for commands generated from protobuf -// rpc methods. -message RpcCommandOptions { - // rpc_method is short name of the protobuf rpc method that this command is - // generated from. - string rpc_method = 1; - - // use is the one-line usage method. It also allows specifying an alternate - // name for the command as the first word of the usage text. - // - // By default the name of an rpc command is the kebab-case short name of the - // rpc method. - string use = 2; - - // long is the long message shown in the 'help ' output. - string long = 3; - - // short is the short description shown in the 'help' output. - string short = 4; - - // example is examples of how to use the command. - string example = 5; - - // alias is an array of aliases that can be used instead of the first word in Use. - repeated string alias = 6; - - // suggest_for is an array of command names for which this command will be suggested - - // similar to aliases but only suggests. - repeated string suggest_for = 7; - - // deprecated defines, if this command is deprecated and should print this string when used. - string deprecated = 8; - - // version defines the version for this command. If this value is non-empty and the command does not - // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, - // will print content of the "Version" variable. A shorthand "v" flag will also be added if the - // command does not define one. - string version = 9; - - // flag_options are options for flags generated from rpc request fields. - // By default all request fields are configured as flags. They can - // also be configured as positional args instead using positional_args. - map flag_options = 10; - - // positional_args specifies positional arguments for the command. - repeated PositionalArgDescriptor positional_args = 11; - - // skip specifies whether to skip this rpc method when generating commands. - bool skip = 12; -} - -// FlagOptions are options for flags generated from rpc request fields. -// By default, all request fields are configured as flags based on the -// kebab-case name of the field. Fields can be turned into positional arguments -// instead by using RpcCommandOptions.positional_args. -message FlagOptions { - - // name is an alternate name to use for the field flag. - string name = 1; - - // shorthand is a one-letter abbreviated flag. - string shorthand = 2; - - // usage is the help message. - string usage = 3; - - // default_value is the default value as text. - string default_value = 4; - - // default value is the default value as text if the flag is used without any value. - string no_opt_default_value = 5; - - // deprecated is the usage text to show if this flag is deprecated. - string deprecated = 6; - - // shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. - string shorthand_deprecated = 7; - - // hidden hides the flag from help/usage text - bool hidden = 8; -} - -// PositionalArgDescriptor describes a positional argument. -message PositionalArgDescriptor { - // proto_field specifies the proto field to use as the positional arg. Any - // fields used as positional args will not have a flag generated. - string proto_field = 1; - - // varargs makes a positional parameter a varargs parameter. This can only be - // applied to last positional parameter and the proto_field must a repeated - // field. - bool varargs = 2; -} diff --git a/proto/cosmos/autocli/v1/query.proto b/proto/cosmos/autocli/v1/query.proto deleted file mode 100644 index a998978e..00000000 --- a/proto/cosmos/autocli/v1/query.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; - -package cosmos.autocli.v1; - -import "cosmos/autocli/v1/options.proto"; -import "cosmos/query/v1/query.proto"; - -option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; - -// RemoteInfoService provides clients with the information they need -// to build dynamically CLI clients for remote chains. -service Query { - // AppOptions returns the autocli options for all of the modules in an app. - rpc AppOptions(AppOptionsRequest) returns (AppOptionsResponse) { - // NOTE: autocli options SHOULD NOT be part of consensus and module_query_safe - // should be kept as false. - option (cosmos.query.v1.module_query_safe) = false; - } -} - -// AppOptionsRequest is the RemoteInfoService/AppOptions request type. -message AppOptionsRequest {} - -// AppOptionsResponse is the RemoteInfoService/AppOptions response type. -message AppOptionsResponse { - // module_options is a map of module name to autocli module options. - map module_options = 1; -} diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto deleted file mode 100644 index 51e3158b..00000000 --- a/proto/cosmos/bank/module/v1/module.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package cosmos.bank.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the bank module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/bank" - }; - - // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. - // If left empty it defaults to the list of account names supplied in the auth module configuration as - // module_account_permissions - repeated string blocked_module_accounts_override = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} \ No newline at end of file diff --git a/proto/cosmos/bank/v1beta1/authz.proto b/proto/cosmos/bank/v1beta1/authz.proto deleted file mode 100644 index a8303536..00000000 --- a/proto/cosmos/bank/v1beta1/authz.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// SendAuthorization allows the grantee to spend up to spend_limit coins from -// the granter's account. -// -// Since: cosmos-sdk 0.43 -message SendAuthorization { - option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; - option (amino.name) = "cosmos-sdk/SendAuthorization"; - - repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the - // granter. If omitted, any recipient is allowed. - // - // Since: cosmos-sdk 0.47 - repeated string allow_list = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto deleted file mode 100644 index f81bb923..00000000 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ /dev/null @@ -1,124 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Params defines the parameters for the bank module. -message Params { - option (amino.name) = "cosmos-sdk/x/bank/Params"; - option (gogoproto.goproto_stringer) = false; - // Deprecated: Use of SendEnabled in params is deprecated. - // For genesis, use the newly added send_enabled field in the genesis object. - // Storage, lookup, and manipulation of this information is now in the keeper. - // - // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. - repeated SendEnabled send_enabled = 1 [deprecated = true]; - bool default_send_enabled = 2; -} - -// SendEnabled maps coin denom to a send_enabled status (whether a denom is -// sendable). -message SendEnabled { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - string denom = 1; - bool enabled = 2; -} - -// Input models transaction input. -message Input { - option (cosmos.msg.v1.signer) = "address"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin coins = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// Output models transaction outputs. -message Output { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin coins = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// Supply represents a struct that passively keeps track of the total supply -// amounts in the network. -// This message is deprecated now that supply is indexed by denom. -message Supply { - option deprecated = true; - - option (gogoproto.equal) = true; - option (gogoproto.goproto_getters) = false; - - option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; - - repeated cosmos.base.v1beta1.Coin total = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// DenomUnit represents a struct that describes a given -// denomination unit of the basic token. -message DenomUnit { - // denom represents the string name of the given denom unit (e.g uatom). - string denom = 1; - // exponent represents power of 10 exponent that one must - // raise the base_denom to in order to equal the given DenomUnit's denom - // 1 denom = 10^exponent base_denom - // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - // exponent = 6, thus: 1 atom = 10^6 uatom). - uint32 exponent = 2; - // aliases is a list of string aliases for the given denom - repeated string aliases = 3; -} - -// Metadata represents a struct that describes -// a basic token. -message Metadata { - string description = 1; - // denom_units represents the list of DenomUnit's for a given coin - repeated DenomUnit denom_units = 2; - // base represents the base denom (should be the DenomUnit with exponent = 0). - string base = 3; - // display indicates the suggested denom that should be - // displayed in clients. - string display = 4; - // name defines the name of the token (eg: Cosmos Atom) - // - // Since: cosmos-sdk 0.43 - string name = 5; - // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - // be the same as the display. - // - // Since: cosmos-sdk 0.43 - string symbol = 6; - // URI to a document (on or off-chain) that contains additional information. Optional. - // - // Since: cosmos-sdk 0.46 - string uri = 7 [(gogoproto.customname) = "URI"]; - // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - // the document didn't change. Optional. - // - // Since: cosmos-sdk 0.46 - string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; -} diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto deleted file mode 100644 index 34214cfb..00000000 --- a/proto/cosmos/bank/v1beta1/genesis.proto +++ /dev/null @@ -1,52 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// GenesisState defines the bank module's genesis state. -message GenesisState { - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // balances is an array containing the balances of all the accounts. - repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - repeated cosmos.base.v1beta1.Coin supply = 3 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - - // denom_metadata defines the metadata of the different coins. - repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // send_enabled defines the denoms where send is enabled or disabled. - // - // Since: cosmos-sdk 0.47 - repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// Balance defines an account address and balance pair used in the bank module's -// genesis state. -message Balance { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the balance holder. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // coins defines the different coins this balance holds. - repeated cosmos.base.v1beta1.Coin coins = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto deleted file mode 100644 index 7abc31ba..00000000 --- a/proto/cosmos/bank/v1beta1/query.proto +++ /dev/null @@ -1,348 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/query/v1/query.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Query defines the gRPC querier service. -service Query { - // Balance queries the balance of a single coin for a single account. - rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; - } - - // AllBalances queries the balance of all coins for a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; - } - - // SpendableBalances queries the spendable balance of all coins for a single - // account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; - } - - // SpendableBalanceByDenom queries the spendable balance of a single denom for - // a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.47 - rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom"; - } - - // TotalSupply queries the total supply of all coins. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; - } - - // SupplyOf queries the supply of a single coin. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; - } - - // Params queries the parameters of x/bank module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; - } - - // DenomsMetadata queries the client metadata of a given coin denomination. - rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; - } - - // DenomsMetadata queries the client metadata for all registered coin - // denominations. - rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; - } - - // DenomOwners queries for all account addresses that own a particular token - // denomination. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; - } - - // SendEnabled queries for SendEnabled entries. - // - // This query only returns denominations that have specific SendEnabled settings. - // Any denomination that does not have a specific setting will use the default - // params.default_send_enabled, and will not be returned by this query. - // - // Since: cosmos-sdk 0.47 - rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; - } -} - -// QueryBalanceRequest is the request type for the Query/Balance RPC method. -message QueryBalanceRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // denom is the coin denom to query balances for. - string denom = 2; -} - -// QueryBalanceResponse is the response type for the Query/Balance RPC method. -message QueryBalanceResponse { - // balance is the balance of the coin. - cosmos.base.v1beta1.Coin balance = 1; -} - -// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -message QueryAllBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -// method. -message QueryAllBalancesResponse { - // balances is the balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySpendableBalancesRequest defines the gRPC request structure for querying -// an account's spendable balances. -// -// Since: cosmos-sdk 0.46 -message QuerySpendableBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query spendable balances for. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QuerySpendableBalancesResponse defines the gRPC response structure for querying -// an account's spendable balances. -// -// Since: cosmos-sdk 0.46 -message QuerySpendableBalancesResponse { - // balances is the spendable balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for -// querying an account's spendable balance for a specific denom. -// -// Since: cosmos-sdk 0.47 -message QuerySpendableBalanceByDenomRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // denom is the coin denom to query balances for. - string denom = 2; -} - -// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for -// querying an account's spendable balance for a specific denom. -// -// Since: cosmos-sdk 0.47 -message QuerySpendableBalanceByDenomResponse { - // balance is the balance of the coin. - cosmos.base.v1beta1.Coin balance = 1; -} - - -// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -// method. -message QueryTotalSupplyRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // pagination defines an optional pagination for the request. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -// method -message QueryTotalSupplyResponse { - // supply is the supply of the coins - repeated cosmos.base.v1beta1.Coin supply = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // pagination defines the pagination in the response. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -message QuerySupplyOfRequest { - // denom is the coin denom to query balances for. - string denom = 1; -} - -// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -message QuerySupplyOfResponse { - // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryParamsRequest defines the request type for querying x/bank parameters. -message QueryParamsRequest {} - -// QueryParamsResponse defines the response type for querying x/bank parameters. -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -message QueryDenomsMetadataRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -// method. -message QueryDenomsMetadataResponse { - // metadata provides the client information for all the registered tokens. - repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -message QueryDenomMetadataRequest { - // denom is the coin denom to query the metadata for. - string denom = 1; -} - -// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -// method. -message QueryDenomMetadataResponse { - // metadata describes and provides all the client information for the requested token. - Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, -// which queries for a paginated set of all account holders of a particular -// denomination. -message QueryDenomOwnersRequest { - // denom defines the coin denomination to query all account holders for. - string denom = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// DenomOwner defines structure representing an account that owns or holds a -// particular denominated token. It contains the account address and account -// balance of the denominated token. -// -// Since: cosmos-sdk 0.46 -message DenomOwner { - // address defines the address that owns a particular denomination. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // balance is the balance of the denominated coin for an account. - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. -// -// Since: cosmos-sdk 0.46 -message QueryDenomOwnersResponse { - repeated DenomOwner denom_owners = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. -// -// Since: cosmos-sdk 0.47 -message QuerySendEnabledRequest { - // denoms is the specific denoms you want look up. Leave empty to get all entries. - repeated string denoms = 1; - // pagination defines an optional pagination for the request. This field is - // only read if the denoms field is empty. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// QuerySendEnabledResponse defines the RPC response of a SendEnable query. -// -// Since: cosmos-sdk 0.47 -message QuerySendEnabledResponse { - repeated SendEnabled send_enabled = 1; - // pagination defines the pagination in the response. This field is only - // populated if the denoms field in the request is empty. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto deleted file mode 100644 index 5d6926ef..00000000 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ /dev/null @@ -1,122 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Msg defines the bank Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // Send defines a method for sending coins from one account to another account. - rpc Send(MsgSend) returns (MsgSendResponse); - - // MultiSend defines a method for sending coins from some accounts to other accounts. - rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); - - // UpdateParams defines a governance operation for updating the x/bank module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - - // SetSendEnabled is a governance operation for setting the SendEnabled flag - // on any number of Denoms. Only the entries to add or update should be - // included. Entries that already exist in the store, but that aren't - // included in this message, will be left unchanged. - // - // Since: cosmos-sdk 0.47 - rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); -} - -// MsgSend represents a message to send coins from one account to another. -message MsgSend { - option (cosmos.msg.v1.signer) = "from_address"; - option (amino.name) = "cosmos-sdk/MsgSend"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgSendResponse defines the Msg/Send response type. -message MsgSendResponse {} - -// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -message MsgMultiSend { - option (cosmos.msg.v1.signer) = "inputs"; - option (amino.name) = "cosmos-sdk/MsgMultiSend"; - - option (gogoproto.equal) = false; - - // Inputs, despite being `repeated`, only allows one sender input. This is - // checked in MsgMultiSend's ValidateBasic. - repeated Input inputs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - repeated Output outputs = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgMultiSendResponse defines the Msg/MultiSend response type. -message MsgMultiSendResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - option (amino.name) = "cosmos-sdk/x/bank/MsgUpdateParams"; - - // params defines the x/bank parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} - -// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -// -// Only entries to add/update/delete need to be included. -// Existing SendEnabled entries that are not included in this -// message are left unchanged. -// -// Since: cosmos-sdk 0.47 -message MsgSetSendEnabled { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; - - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // send_enabled is the list of entries to add or update. - repeated SendEnabled send_enabled = 2; - - // use_default_for is a list of denoms that should use the params.default_send_enabled value. - // Denoms listed here will have their SendEnabled entries deleted. - // If a denom is included that doesn't have a SendEnabled entry, - // it will be ignored. - repeated string use_default_for = 3; -} - -// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -// -// Since: cosmos-sdk 0.47 -message MsgSetSendEnabledResponse {} diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto deleted file mode 100644 index ddaa6356..00000000 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ /dev/null @@ -1,158 +0,0 @@ -syntax = "proto3"; -package cosmos.base.abci.v1beta1; - -import "gogoproto/gogo.proto"; -import "tendermint/abci/types.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; - -// TxResponse defines a structure containing relevant tx data and metadata. The -// tags are stringified and the log is JSON decoded. -message TxResponse { - option (gogoproto.goproto_getters) = false; - // The block height - int64 height = 1; - // The transaction hash. - string txhash = 2 [(gogoproto.customname) = "TxHash"]; - // Namespace for the Code - string codespace = 3; - // Response code. - uint32 code = 4; - // Result bytes, if any. - string data = 5; - // The output of the application's logger (raw string). May be - // non-deterministic. - string raw_log = 6; - // The output of the application's logger (typed). May be non-deterministic. - repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; - // Additional information. May be non-deterministic. - string info = 8; - // Amount of gas requested for transaction. - int64 gas_wanted = 9; - // Amount of gas consumed by transaction. - int64 gas_used = 10; - // The request transaction bytes. - google.protobuf.Any tx = 11; - // Time of the previous block. For heights > 1, it's the weighted median of - // the timestamps of the valid votes in the block.LastCommit. For height == 1, - // it's genesis time. - string timestamp = 12; - // Events defines all the events emitted by processing a transaction. Note, - // these events include those emitted by processing all the messages and those - // emitted from the ante. Whereas Logs contains the events, with - // additional metadata, emitted only by processing the messages. - // - // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; -} - -// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. -message ABCIMessageLog { - option (gogoproto.stringer) = true; - - uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; - string log = 2; - - // Events contains a slice of Event objects that were emitted during some - // execution. - repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; -} - -// StringEvent defines en Event object wrapper where all the attributes -// contain key/value pairs that are strings instead of raw bytes. -message StringEvent { - option (gogoproto.stringer) = true; - - string type = 1; - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; -} - -// Attribute defines an attribute wrapper where the key and value are -// strings instead of raw bytes. -message Attribute { - string key = 1; - string value = 2; -} - -// GasInfo defines tx execution gas context. -message GasInfo { - // GasWanted is the maximum units of work we allow this tx to perform. - uint64 gas_wanted = 1; - - // GasUsed is the amount of gas actually consumed. - uint64 gas_used = 2; -} - -// Result is the union of ResponseFormat and ResponseCheckTx. -message Result { - option (gogoproto.goproto_getters) = false; - - // Data is any data returned from message or handler execution. It MUST be - // length prefixed in order to separate data from multiple message executions. - // Deprecated. This field is still populated, but prefer msg_response instead - // because it also contains the Msg response typeURL. - bytes data = 1 [deprecated = true]; - - // Log contains the log information from message or handler execution. - string log = 2; - - // Events contains a slice of Event objects that were emitted during message - // or handler execution. - repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; - - // msg_responses contains the Msg handler responses type packed in Anys. - // - // Since: cosmos-sdk 0.46 - repeated google.protobuf.Any msg_responses = 4; -} - -// SimulationResponse defines the response generated when a transaction is -// successfully simulated. -message SimulationResponse { - GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - Result result = 2; -} - -// MsgData defines the data returned in a Result object during message -// execution. -message MsgData { - option deprecated = true; - option (gogoproto.stringer) = true; - - string msg_type = 1; - bytes data = 2; -} - -// TxMsgData defines a list of MsgData. A transaction will have a MsgData object -// for each message. -message TxMsgData { - option (gogoproto.stringer) = true; - - // data field is deprecated and not populated. - repeated MsgData data = 1 [deprecated = true]; - - // msg_responses contains the Msg handler responses packed into Anys. - // - // Since: cosmos-sdk 0.46 - repeated google.protobuf.Any msg_responses = 2; -} - -// SearchTxsResult defines a structure for querying txs pageable -message SearchTxsResult { - option (gogoproto.stringer) = true; - - // Count of all txs - uint64 total_count = 1; - // Count of txs in current page - uint64 count = 2; - // Index of current page, start from 1 - uint64 page_number = 3; - // Count of total pages - uint64 page_total = 4; - // Max count txs per page - uint64 limit = 5; - // List of txs in current page - repeated TxResponse txs = 6; -} diff --git a/proto/cosmos/base/kv/v1beta1/kv.proto b/proto/cosmos/base/kv/v1beta1/kv.proto deleted file mode 100644 index 4e9b8d28..00000000 --- a/proto/cosmos/base/kv/v1beta1/kv.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.base.kv.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; - -// Pairs defines a repeated slice of Pair objects. -message Pairs { - repeated Pair pairs = 1 [(gogoproto.nullable) = false]; -} - -// Pair defines a key/value bytes tuple. -message Pair { - bytes key = 1; - bytes value = 2; -} diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto deleted file mode 100644 index 8070f7b9..00000000 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package cosmos.base.node.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; - -// Service defines the gRPC querier service for node related queries. -service Service { - // Config queries for the operator configuration. - rpc Config(ConfigRequest) returns (ConfigResponse) { - option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; - } -} - -// ConfigRequest defines the request structure for the Config gRPC query. -message ConfigRequest {} - -// ConfigResponse defines the response structure for the Config gRPC query. -message ConfigResponse { - string minimum_gas_price = 1; -} diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto deleted file mode 100644 index 0a368144..00000000 --- a/proto/cosmos/base/query/v1beta1/pagination.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; -package cosmos.base.query.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/types/query"; - -// PageRequest is to be embedded in gRPC request messages for efficient -// pagination. Ex: -// -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } -message PageRequest { - // key is a value returned in PageResponse.next_key to begin - // querying the next page most efficiently. Only one of offset or key - // should be set. - bytes key = 1; - - // offset is a numeric offset that can be used when key is unavailable. - // It is less efficient than using key. Only one of offset or key should - // be set. - uint64 offset = 2; - - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - uint64 limit = 3; - - // count_total is set to true to indicate that the result set should include - // a count of the total number of items available for pagination in UIs. - // count_total is only respected when offset is used. It is ignored when key - // is set. - bool count_total = 4; - - // reverse is set to true if results are to be returned in the descending order. - // - // Since: cosmos-sdk 0.43 - bool reverse = 5; -} - -// PageResponse is to be embedded in gRPC response messages where the -// corresponding request message has used PageRequest. -// -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } -message PageResponse { - // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently. It will be empty if - // there are no more results. - bytes next_key = 1; - - // total is total number of results available if PageRequest.count_total - // was set, its value is undefined otherwise - uint64 total = 2; -} diff --git a/proto/cosmos/base/reflection/v1beta1/reflection.proto b/proto/cosmos/base/reflection/v1beta1/reflection.proto deleted file mode 100644 index 22670e72..00000000 --- a/proto/cosmos/base/reflection/v1beta1/reflection.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; -package cosmos.base.reflection.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; - -// ReflectionService defines a service for interface reflection. -service ReflectionService { - // ListAllInterfaces lists all the interfaces registered in the interface - // registry. - rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; - }; - - // ListImplementations list all the concrete types that implement a given - // interface. - rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" - "{interface_name}/implementations"; - }; -} - -// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. -message ListAllInterfacesRequest {} - -// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. -message ListAllInterfacesResponse { - // interface_names is an array of all the registered interfaces. - repeated string interface_names = 1; -} - -// ListImplementationsRequest is the request type of the ListImplementations -// RPC. -message ListImplementationsRequest { - // interface_name defines the interface to query the implementations for. - string interface_name = 1; -} - -// ListImplementationsResponse is the response type of the ListImplementations -// RPC. -message ListImplementationsResponse { - repeated string implementation_message_names = 1; -} diff --git a/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/proto/cosmos/base/reflection/v2alpha1/reflection.proto deleted file mode 100644 index d5b04855..00000000 --- a/proto/cosmos/base/reflection/v2alpha1/reflection.proto +++ /dev/null @@ -1,218 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.base.reflection.v2alpha1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; - -// AppDescriptor describes a cosmos-sdk based application -message AppDescriptor { - // AuthnDescriptor provides information on how to authenticate transactions on the application - // NOTE: experimental and subject to change in future releases. - AuthnDescriptor authn = 1; - // chain provides the chain descriptor - ChainDescriptor chain = 2; - // codec provides metadata information regarding codec related types - CodecDescriptor codec = 3; - // configuration provides metadata information regarding the sdk.Config type - ConfigurationDescriptor configuration = 4; - // query_services provides metadata information regarding the available queriable endpoints - QueryServicesDescriptor query_services = 5; - // tx provides metadata information regarding how to send transactions to the given application - TxDescriptor tx = 6; -} - -// TxDescriptor describes the accepted transaction type -message TxDescriptor { - // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - // it is not meant to support polymorphism of transaction types, it is supposed to be used by - // reflection clients to understand if they can handle a specific transaction type in an application. - string fullname = 1; - // msgs lists the accepted application messages (sdk.Msg) - repeated MsgDescriptor msgs = 2; -} - -// AuthnDescriptor provides information on how to sign transactions without relying -// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures -message AuthnDescriptor { - // sign_modes defines the supported signature algorithm - repeated SigningModeDescriptor sign_modes = 1; -} - -// SigningModeDescriptor provides information on a signing flow of the application -// NOTE(fdymylja): here we could go as far as providing an entire flow on how -// to sign a message given a SigningModeDescriptor, but it's better to think about -// this another time -message SigningModeDescriptor { - // name defines the unique name of the signing mode - string name = 1; - // number is the unique int32 identifier for the sign_mode enum - int32 number = 2; - // authn_info_provider_method_fullname defines the fullname of the method to call to get - // the metadata required to authenticate using the provided sign_modes - string authn_info_provider_method_fullname = 3; -} - -// ChainDescriptor describes chain information of the application -message ChainDescriptor { - // id is the chain id - string id = 1; -} - -// CodecDescriptor describes the registered interfaces and provides metadata information on the types -message CodecDescriptor { - // interfaces is a list of the registerted interfaces descriptors - repeated InterfaceDescriptor interfaces = 1; -} - -// InterfaceDescriptor describes the implementation of an interface -message InterfaceDescriptor { - // fullname is the name of the interface - string fullname = 1; - // interface_accepting_messages contains information regarding the proto messages which contain the interface as - // google.protobuf.Any field - repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; - // interface_implementers is a list of the descriptors of the interface implementers - repeated InterfaceImplementerDescriptor interface_implementers = 3; -} - -// InterfaceImplementerDescriptor describes an interface implementer -message InterfaceImplementerDescriptor { - // fullname is the protobuf queryable name of the interface implementer - string fullname = 1; - // type_url defines the type URL used when marshalling the type as any - // this is required so we can provide type safe google.protobuf.Any marshalling and - // unmarshalling, making sure that we don't accept just 'any' type - // in our interface fields - string type_url = 2; -} - -// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains -// an interface represented as a google.protobuf.Any -message InterfaceAcceptingMessageDescriptor { - // fullname is the protobuf fullname of the type containing the interface - string fullname = 1; - // field_descriptor_names is a list of the protobuf name (not fullname) of the field - // which contains the interface as google.protobuf.Any (the interface is the same, but - // it can be in multiple fields of the same proto message) - repeated string field_descriptor_names = 2; -} - -// ConfigurationDescriptor contains metadata information on the sdk.Config -message ConfigurationDescriptor { - // bech32_account_address_prefix is the account address prefix - string bech32_account_address_prefix = 1; -} - -// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction -message MsgDescriptor { - // msg_type_url contains the TypeURL of a sdk.Msg. - string msg_type_url = 1; -} - -// ReflectionService defines a service for application reflection. -service ReflectionService { - // GetAuthnDescriptor returns information on how to authenticate transactions in the application - // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - // future releases of the cosmos-sdk. - rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; - } - // GetChainDescriptor returns the description of the chain - rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; - }; - // GetCodecDescriptor returns the descriptor of the codec of the application - rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; - } - // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; - } - // GetQueryServicesDescriptor returns the available gRPC queryable services of the application - rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; - } - // GetTxDescriptor returns information on the used transaction object and available msgs that can be used - rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; - } -} - -// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC -message GetAuthnDescriptorRequest {} -// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC -message GetAuthnDescriptorResponse { - // authn describes how to authenticate to the application when sending transactions - AuthnDescriptor authn = 1; -} - -// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC -message GetChainDescriptorRequest {} -// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC -message GetChainDescriptorResponse { - // chain describes application chain information - ChainDescriptor chain = 1; -} - -// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC -message GetCodecDescriptorRequest {} -// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC -message GetCodecDescriptorResponse { - // codec describes the application codec such as registered interfaces and implementations - CodecDescriptor codec = 1; -} - -// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorRequest {} -// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorResponse { - // config describes the application's sdk.Config - ConfigurationDescriptor config = 1; -} - -// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorRequest {} -// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorResponse { - // queries provides information on the available queryable services - QueryServicesDescriptor queries = 1; -} - -// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC -message GetTxDescriptorRequest {} -// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC -message GetTxDescriptorResponse { - // tx provides information on msgs that can be forwarded to the application - // alongside the accepted transaction protobuf type - TxDescriptor tx = 1; -} - -// QueryServicesDescriptor contains the list of cosmos-sdk queriable services -message QueryServicesDescriptor { - // query_services is a list of cosmos-sdk QueryServiceDescriptor - repeated QueryServiceDescriptor query_services = 1; -} - -// QueryServiceDescriptor describes a cosmos-sdk queryable service -message QueryServiceDescriptor { - // fullname is the protobuf fullname of the service descriptor - string fullname = 1; - // is_module describes if this service is actually exposed by an application's module - bool is_module = 2; - // methods provides a list of query service methods - repeated QueryMethodDescriptor methods = 3; -} - -// QueryMethodDescriptor describes a queryable method of a query service -// no other info is provided beside method name and tendermint queryable path -// because it would be redundant with the grpc reflection service -message QueryMethodDescriptor { - // name is the protobuf name (not fullname) of the method - string name = 1; - // full_query_path is the path that can be used to query - // this method via tendermint abci.Query - string full_query_path = 2; -} diff --git a/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/proto/cosmos/base/snapshots/v1beta1/snapshot.proto deleted file mode 100644 index e8f9c2e6..00000000 --- a/proto/cosmos/base/snapshots/v1beta1/snapshot.proto +++ /dev/null @@ -1,90 +0,0 @@ -syntax = "proto3"; -package cosmos.base.snapshots.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; - -// Snapshot contains Tendermint state sync snapshot info. -message Snapshot { - uint64 height = 1; - uint32 format = 2; - uint32 chunks = 3; - bytes hash = 4; - Metadata metadata = 5 [(gogoproto.nullable) = false]; -} - -// Metadata contains SDK-specific snapshot metadata. -message Metadata { - repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes -} - -// SnapshotItem is an item contained in a rootmulti.Store snapshot. -// -// Since: cosmos-sdk 0.46 -message SnapshotItem { - // item is the specific type of snapshot item. - oneof item { - SnapshotStoreItem store = 1; - SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; - SnapshotExtensionMeta extension = 3; - SnapshotExtensionPayload extension_payload = 4; - SnapshotKVItem kv = 5 [deprecated = true, (gogoproto.customname) = "KV"]; - SnapshotSchema schema = 6 [deprecated = true]; - } -} - -// SnapshotStoreItem contains metadata about a snapshotted store. -// -// Since: cosmos-sdk 0.46 -message SnapshotStoreItem { - string name = 1; -} - -// SnapshotIAVLItem is an exported IAVL node. -// -// Since: cosmos-sdk 0.46 -message SnapshotIAVLItem { - bytes key = 1; - bytes value = 2; - // version is block height - int64 version = 3; - // height is depth of the tree. - int32 height = 4; -} - -// SnapshotExtensionMeta contains metadata about an external snapshotter. -// -// Since: cosmos-sdk 0.46 -message SnapshotExtensionMeta { - string name = 1; - uint32 format = 2; -} - -// SnapshotExtensionPayload contains payloads of an external snapshotter. -// -// Since: cosmos-sdk 0.46 -message SnapshotExtensionPayload { - bytes payload = 1; -} - -// SnapshotKVItem is an exported Key/Value Pair -// -// Since: cosmos-sdk 0.46 -// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -message SnapshotKVItem { - option deprecated = true; - - bytes key = 1; - bytes value = 2; -} - -// SnapshotSchema is an exported schema of smt store -// -// Since: cosmos-sdk 0.46 -// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -message SnapshotSchema { - option deprecated = true; - - repeated bytes keys = 1; -} \ No newline at end of file diff --git a/proto/cosmos/base/store/v1beta1/commit_info.proto b/proto/cosmos/base/store/v1beta1/commit_info.proto deleted file mode 100644 index 4625cdab..00000000 --- a/proto/cosmos/base/store/v1beta1/commit_info.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// CommitInfo defines commit information used by the multi-store when committing -// a version/height. -message CommitInfo { - int64 version = 1; - repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -// StoreInfo defines store-specific commit information. It contains a reference -// between a store name and the commit ID. -message StoreInfo { - string name = 1; - CommitID commit_id = 2 [(gogoproto.nullable) = false]; -} - -// CommitID defines the commitment information when a specific store is -// committed. -message CommitID { - option (gogoproto.goproto_stringer) = false; - - int64 version = 1; - bytes hash = 2; -} diff --git a/proto/cosmos/base/store/v1beta1/listening.proto b/proto/cosmos/base/store/v1beta1/listening.proto deleted file mode 100644 index 753f7c16..00000000 --- a/proto/cosmos/base/store/v1beta1/listening.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -import "tendermint/abci/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -// Deletes -// -// Since: cosmos-sdk 0.43 -message StoreKVPair { - string store_key = 1; // the store key for the KVStore this pair originates from - bool delete = 2; // true indicates a delete operation, false indicates a set operation - bytes key = 3; - bytes value = 4; -} - -// BlockMetadata contains all the abci event data of a block -// the file streamer dump them into files together with the state changes. -message BlockMetadata { - // DeliverTx encapulate deliver tx request and response. - message DeliverTx { - tendermint.abci.RequestDeliverTx request = 1; - tendermint.abci.ResponseDeliverTx response = 2; - } - tendermint.abci.RequestBeginBlock request_begin_block = 1; - tendermint.abci.ResponseBeginBlock response_begin_block = 2; - repeated DeliverTx deliver_txs = 3; - tendermint.abci.RequestEndBlock request_end_block = 4; - tendermint.abci.ResponseEndBlock response_end_block = 5; - tendermint.abci.ResponseCommit response_commit = 6; -} diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto deleted file mode 100644 index 1f17b0a6..00000000 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ /dev/null @@ -1,208 +0,0 @@ -syntax = "proto3"; -package cosmos.base.tendermint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "tendermint/p2p/types.proto"; -import "tendermint/types/types.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/base/tendermint/v1beta1/types.proto"; -import "cosmos_proto/cosmos.proto"; -import "tendermint/types/block.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; - -// Service defines the gRPC querier service for tendermint queries. -service Service { - // GetNodeInfo queries the current node info. - rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; - } - - // GetSyncing queries node syncing. - rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; - } - - // GetLatestBlock returns the latest block. - rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; - } - - // GetBlockByHeight queries block for given height. - rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; - } - - // GetLatestValidatorSet queries latest validator-set. - rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; - } - - // GetValidatorSetByHeight queries validator-set at a given height. - rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; - } - - // ABCIQuery defines a query handler that supports ABCI queries directly to the - // application, bypassing Tendermint completely. The ABCI query must contain - // a valid and supported path, including app, custom, p2p, and store. - // - // Since: cosmos-sdk 0.46 - rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/abci_query"; - } -} - -// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightRequest { - int64 height = 1; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetRequest { - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// Validator is the type for the validator-set. -message Validator { - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightRequest { - int64 height = 1; -} - -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightResponse { - .tendermint.types.BlockID block_id = 1; - - // Deprecated: please use `sdk_block` instead - .tendermint.types.Block block = 2; - - // Since: cosmos-sdk 0.47 - Block sdk_block = 3; -} - -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. -message GetLatestBlockRequest {} - -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. -message GetLatestBlockResponse { - .tendermint.types.BlockID block_id = 1; - - // Deprecated: please use `sdk_block` instead - .tendermint.types.Block block = 2; - - // Since: cosmos-sdk 0.47 - Block sdk_block = 3; -} - -// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. -message GetSyncingRequest {} - -// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. -message GetSyncingResponse { - bool syncing = 1; -} - -// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. -message GetNodeInfoRequest {} - -// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. -message GetNodeInfoResponse { - .tendermint.p2p.DefaultNodeInfo default_node_info = 1; - VersionInfo application_version = 2; -} - -// VersionInfo is the type for the GetNodeInfoResponse message. -message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; - // Since: cosmos-sdk 0.43 - string cosmos_sdk_version = 8; -} - -// Module is the type for VersionInfo -message Module { - // module path - string path = 1; - // module version - string version = 2; - // checksum - string sum = 3; -} - -// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. -message ABCIQueryRequest { - bytes data = 1; - string path = 2; - int64 height = 3; - bool prove = 4; -} - -// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. -// -// Note: This type is a duplicate of the ResponseQuery proto type defined in -// Tendermint. -message ABCIQueryResponse { - uint32 code = 1; - // DEPRECATED: use "value" instead - reserved 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 index = 5; - bytes key = 6; - bytes value = 7; - ProofOps proof_ops = 8; - int64 height = 9; - string codespace = 10; -} - -// ProofOp defines an operation used for calculating Merkle root. The data could -// be arbitrary format, providing necessary data for example neighbouring node -// hash. -// -// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. -message ProofOp { - string type = 1; - bytes key = 2; - bytes data = 3; -} - -// ProofOps is Merkle proof defined by the list of ProofOps. -// -// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. -message ProofOps { - repeated ProofOp ops = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/base/tendermint/v1beta1/types.proto b/proto/cosmos/base/tendermint/v1beta1/types.proto deleted file mode 100644 index 6506997b..00000000 --- a/proto/cosmos/base/tendermint/v1beta1/types.proto +++ /dev/null @@ -1,52 +0,0 @@ -syntax = "proto3"; -package cosmos.base.tendermint.v1beta1; - -import "gogoproto/gogo.proto"; -import "tendermint/types/types.proto"; -import "tendermint/types/evidence.proto"; -import "tendermint/version/types.proto"; -import "google/protobuf/timestamp.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; - -// Block is tendermint type Block, with the Header proposer address -// field converted to bech32 string. -message Block { - Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - .tendermint.types.Data data = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - .tendermint.types.Commit last_commit = 4; -} - -// Header defines the structure of a Tendermint block header. -message Header { - // basic block info - .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string chain_id = 2 [(gogoproto.customname) = "ChainID"]; - int64 height = 3; - google.protobuf.Timestamp time = 4 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - - // prev block info - .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions - - // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block - - // consensus info - bytes evidence_hash = 13; // evidence included in the block - - // proposer_address is the original block proposer address, formatted as a Bech32 string. - // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string - // for better UX. - string proposer_address = 14; // original proposer of the block -} diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto deleted file mode 100644 index 69c96f67..00000000 --- a/proto/cosmos/base/v1beta1/coin.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; -package cosmos.base.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; - -// Coin defines a token with a denomination and an amount. -// -// NOTE: The amount field is an Int which implements the custom method -// signatures required by gogoproto. -message Coin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "Int", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// DecCoin defines a token with a denomination and a decimal amount. -// -// NOTE: The amount field is an Dec which implements the custom method -// signatures required by gogoproto. -message DecCoin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} - -// IntProto defines a Protobuf wrapper around an Int object. -message IntProto { - string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecProto defines a Protobuf wrapper around a Dec object. -message DecProto { - string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} diff --git a/proto/cosmos/capability/module/v1/module.proto b/proto/cosmos/capability/module/v1/module.proto deleted file mode 100644 index eabaadc1..00000000 --- a/proto/cosmos/capability/module/v1/module.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package cosmos.capability.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the capability module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/capability" - }; - - // seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped - // keeper. For more details check x/capability/keeper.go. - bool seal_keeper = 1; -} \ No newline at end of file diff --git a/proto/cosmos/capability/v1beta1/capability.proto b/proto/cosmos/capability/v1beta1/capability.proto deleted file mode 100644 index 6f3595f1..00000000 --- a/proto/cosmos/capability/v1beta1/capability.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -import "gogoproto/gogo.proto"; -import "amino/amino.proto"; - -// Capability defines an implementation of an object capability. The index -// provided to a Capability must be globally unique. -message Capability { - option (gogoproto.goproto_stringer) = false; - - uint64 index = 1; -} - -// Owner defines a single capability owner. An owner is defined by the name of -// capability and the module name. -message Owner { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - string module = 1; - string name = 2; -} - -// CapabilityOwners defines a set of owners of a single Capability. The set of -// owners must be unique. -message CapabilityOwners { - repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/capability/v1beta1/genesis.proto b/proto/cosmos/capability/v1beta1/genesis.proto deleted file mode 100644 index f119244e..00000000 --- a/proto/cosmos/capability/v1beta1/genesis.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/capability/v1beta1/capability.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -// GenesisOwners defines the capability owners with their corresponding index. -message GenesisOwners { - // index is the index of the capability owner. - uint64 index = 1; - - // index_owners are the owners at the given index. - CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// GenesisState defines the capability module's genesis state. -message GenesisState { - // index is the capability global index. - uint64 index = 1; - - // owners represents a map from index to owners of the capability index - // index key is string to allow amino marshalling. - repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/consensus/module/v1/module.proto b/proto/cosmos/consensus/module/v1/module.proto deleted file mode 100644 index 8e188cc7..00000000 --- a/proto/cosmos/consensus/module/v1/module.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package cosmos.consensus.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the consensus module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/consensus" - }; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 1; -} diff --git a/proto/cosmos/consensus/v1/query.proto b/proto/cosmos/consensus/v1/query.proto deleted file mode 100644 index cdcb07ba..00000000 --- a/proto/cosmos/consensus/v1/query.proto +++ /dev/null @@ -1,27 +0,0 @@ -// Since: cosmos-sdk 0.47 -syntax = "proto3"; -package cosmos.consensus.v1; - -import "google/api/annotations.proto"; -import "tendermint/types/params.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; - -// Query defines the gRPC querier service. -service Query { - // Params queries the parameters of x/consensus_param module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/consensus/v1/params"; - } -} - -// QueryParamsRequest defines the request type for querying x/consensus parameters. -message QueryParamsRequest {} - -// QueryParamsResponse defines the response type for querying x/consensus parameters. -message QueryParamsResponse { - // params are the tendermint consensus params stored in the consensus module. - // Please note that `params.version` is not populated in this response, it is - // tracked separately in the x/upgrade module. - tendermint.types.ConsensusParams params = 1; -} diff --git a/proto/cosmos/consensus/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto deleted file mode 100644 index 0a7a3de0..00000000 --- a/proto/cosmos/consensus/v1/tx.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Since: cosmos-sdk 0.47 -syntax = "proto3"; -package cosmos.consensus.v1; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "tendermint/types/params.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; - -// Msg defines the bank Msg service. -service Msg { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type. -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/consensus parameters to update. - // VersionsParams is not included in this Msg because it is tracked - // separarately in x/upgrade. - // - // NOTE: All parameters must be supplied. - tendermint.types.BlockParams block = 2; - tendermint.types.EvidenceParams evidence = 3; - tendermint.types.ValidatorParams validator = 4; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crisis/module/v1/module.proto b/proto/cosmos/crisis/module/v1/module.proto deleted file mode 100644 index fe924962..00000000 --- a/proto/cosmos/crisis/module/v1/module.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package cosmos.crisis.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the crisis module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/crisis" - }; - - // fee_collector_name is the name of the FeeCollector ModuleAccount. - string fee_collector_name = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} \ No newline at end of file diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto deleted file mode 100644 index b0ddb9b6..00000000 --- a/proto/cosmos/crisis/v1beta1/genesis.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "amino/amino.proto"; - -// GenesisState defines the crisis module's genesis state. -message GenesisState { - // constant_fee is the fee used to verify the invariant in the crisis - // module. - cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto deleted file mode 100644 index 4fcf5bf6..00000000 --- a/proto/cosmos/crisis/v1beta1/tx.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// Msg defines the bank Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // VerifyInvariant defines a method to verify a particular invariant. - rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); - - // UpdateParams defines a governance operation for updating the x/crisis module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgVerifyInvariant represents a message to verify a particular invariance. -message MsgVerifyInvariant { - option (cosmos.msg.v1.signer) = "sender"; - option (amino.name) = "cosmos-sdk/MsgVerifyInvariant"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // sender is the account address of private key to send coins to fee collector account. - string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // name of the invariant module. - string invariant_module_name = 2; - - // invariant_route is the msg's invariant route. - string invariant_route = 3; -} - -// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. -message MsgVerifyInvariantResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/crisis/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // constant_fee defines the x/crisis parameter. - cosmos.base.v1beta1.Coin constant_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crypto/ed25519/keys.proto b/proto/cosmos/crypto/ed25519/keys.proto deleted file mode 100644 index 728b5483..00000000 --- a/proto/cosmos/crypto/ed25519/keys.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.ed25519; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; - -// PubKey is an ed25519 public key for handling Tendermint keys in SDK. -// It's needed for Any serialization and SDK compatibility. -// It must not be used in a non Tendermint key context because it doesn't implement -// ADR-28. Nevertheless, you will like to use ed25519 in app user level -// then you must create a new proto message and follow ADR-28 for Address construction. -message PubKey { - option (amino.name) = "tendermint/PubKeyEd25519"; - // The Amino encoding is simply the inner bytes field, and not the Amino - // encoding of the whole PubKey struct. - // - // Example (JSON): - // s := PubKey{Key: []byte{0x01}} - // out := AminoJSONEncoder(s) - // - // Then we have: - // out == `"MQ=="` - // out != `{"key":"MQ=="}` - option (amino.message_encoding) = "key_field"; - option (gogoproto.goproto_stringer) = false; - - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; -} - -// Deprecated: PrivKey defines a ed25519 private key. -// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. -message PrivKey { - option (amino.name) = "tendermint/PrivKeyEd25519"; - option (amino.message_encoding) = "key_field"; - - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; -} diff --git a/proto/cosmos/crypto/hd/v1/hd.proto b/proto/cosmos/crypto/hd/v1/hd.proto deleted file mode 100644 index e25b70d1..00000000 --- a/proto/cosmos/crypto/hd/v1/hd.proto +++ /dev/null @@ -1,27 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.crypto.hd.v1; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; -option (gogoproto.goproto_getters_all) = false; - -// BIP44Params is used as path field in ledger item in Record. -message BIP44Params { - option (amino.name) = "crypto/keys/hd/BIP44Params"; - - option (gogoproto.goproto_stringer) = false; - // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation - uint32 purpose = 1; - // coin_type is a constant that improves privacy - uint32 coin_type = 2; - // account splits the key space into independent user identities - uint32 account = 3; - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - // chain. - bool change = 4; - // address_index is used as child index in BIP32 derivation - uint32 address_index = 5; -} diff --git a/proto/cosmos/crypto/keyring/v1/record.proto b/proto/cosmos/crypto/keyring/v1/record.proto deleted file mode 100644 index e79ea7f4..00000000 --- a/proto/cosmos/crypto/keyring/v1/record.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.crypto.keyring.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/crypto/hd/v1/hd.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.gogoproto_import) = false; - -// Record is used for representing a key in the keyring. -message Record { - // name represents a name of Record - string name = 1; - // pub_key represents a public key in any format - google.protobuf.Any pub_key = 2; - - // Record contains one of the following items - oneof item { - // local stores the private key locally. - Local local = 3; - // ledger stores the information about a Ledger key. - Ledger ledger = 4; - // Multi does not store any other information. - Multi multi = 5; - // Offline does not store any other information. - Offline offline = 6; - } - - // Item is a keyring item stored in a keyring backend. - // Local item - message Local { - google.protobuf.Any priv_key = 1; - } - - // Ledger item - message Ledger { - hd.v1.BIP44Params path = 1; - } - - // Multi item - message Multi {} - - // Offline item - message Offline {} -} diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto deleted file mode 100644 index fa0dec57..00000000 --- a/proto/cosmos/crypto/multisig/keys.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; - -// LegacyAminoPubKey specifies a public key type -// which nests multiple public keys and a threshold, -// it uses legacy amino address rules. -message LegacyAminoPubKey { - option (amino.name) = "tendermint/PubKeyMultisigThreshold"; - // The Amino encoding of a LegacyAminoPubkey is the legacy amino - // encoding of the `PubKeyMultisigThreshold` struct defined below: - // https://github.com/tendermint/tendermint/blob/v0.33.9/crypto/multisig/threshold_pubkey.go - // - // There are 2 differences with what a "normal" Amino encoding - // would output: - // 1. The `threshold` field is always a string (whereas Amino would - // by default marshal uint32 as a number). - // 2. The `public_keys` field is renamed to `pubkeys`, which is also - // reflected in the `amino.field_name` annotation. - option (amino.message_encoding) = "threshold_string"; - option (gogoproto.goproto_getters) = false; - - uint32 threshold = 1; - repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (amino.field_name) = "pubkeys"]; -} diff --git a/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/proto/cosmos/crypto/multisig/v1beta1/multisig.proto deleted file mode 100644 index bf671f17..00000000 --- a/proto/cosmos/crypto/multisig/v1beta1/multisig.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; - -// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. -// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers -// signed and with which modes. -message MultiSignature { - option (gogoproto.goproto_unrecognized) = true; - repeated bytes signatures = 1; -} - -// CompactBitArray is an implementation of a space efficient bit array. -// This is used to ensure that the encoded data takes up a minimal amount of -// space after proto encoding. -// This is not thread safe, and is not intended for concurrent usage. -message CompactBitArray { - option (gogoproto.goproto_stringer) = false; - - uint32 extra_bits_stored = 1; - bytes elems = 2; -} diff --git a/proto/cosmos/crypto/secp256k1/keys.proto b/proto/cosmos/crypto/secp256k1/keys.proto deleted file mode 100644 index e2358d6d..00000000 --- a/proto/cosmos/crypto/secp256k1/keys.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.secp256k1; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; - -// PubKey defines a secp256k1 public key -// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -message PubKey { - option (amino.name) = "tendermint/PubKeySecp256k1"; - // The Amino encoding is simply the inner bytes field, and not the Amino - // encoding of the whole PubKey struct. - // - // Example (JSON): - // s := PubKey{Key: []byte{0x01}} - // out := AminoJSONEncoder(s) - // - // Then we have: - // out == `"MQ=="` - // out != `{"key":"MQ=="}` - option (amino.message_encoding) = "key_field"; - option (gogoproto.goproto_stringer) = false; - - bytes key = 1; -} - -// PrivKey defines a secp256k1 private key. -message PrivKey { - option (amino.name) = "tendermint/PrivKeySecp256k1"; - option (amino.message_encoding) = "key_field"; - - bytes key = 1; -} diff --git a/proto/cosmos/crypto/secp256r1/keys.proto b/proto/cosmos/crypto/secp256r1/keys.proto deleted file mode 100644 index 2e96c6e3..00000000 --- a/proto/cosmos/crypto/secp256r1/keys.proto +++ /dev/null @@ -1,23 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.crypto.secp256r1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; -option (gogoproto.messagename_all) = true; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// PubKey defines a secp256r1 ECDSA public key. -message PubKey { - // Point on secp256r1 curve in a compressed representation as specified in section - // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; -} - -// PrivKey defines a secp256r1 ECDSA private key. -message PrivKey { - // secret number serialized using big-endian encoding - bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; -} diff --git a/proto/cosmos/distribution/module/v1/module.proto b/proto/cosmos/distribution/module/v1/module.proto deleted file mode 100644 index accf920c..00000000 --- a/proto/cosmos/distribution/module/v1/module.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package cosmos.distribution.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the distribution module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/distribution" - }; - - string fee_collector_name = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} \ No newline at end of file diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto deleted file mode 100644 index 226003da..00000000 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ /dev/null @@ -1,194 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// Params defines the set of params for the distribution module. -message Params { - option (amino.name) = "cosmos-sdk/x/distribution/Params"; - option (gogoproto.goproto_stringer) = false; - - string community_tax = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - - // Deprecated: The base_proposer_reward field is deprecated and is no longer used - // in the x/distribution module's reward mechanism. - string base_proposer_reward = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - deprecated = true - ]; - - // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used - // in the x/distribution module's reward mechanism. - string bonus_proposer_reward = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - deprecated = true - ]; - - bool withdraw_addr_enabled = 4; -} - -// ValidatorHistoricalRewards represents historical rewards for a validator. -// Height is implicit within the store key. -// Cumulative reward ratio is the sum from the zeroeth period -// until this period of rewards / tokens, per the spec. -// The reference count indicates the number of objects -// which might need to reference this historical entry at any point. -// ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization -message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - uint32 reference_count = 2; -} - -// ValidatorCurrentRewards represents current rewards and current -// period for a validator kept as a running counter and incremented -// each block as long as the validator's tokens remain constant. -message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - uint64 period = 2; -} - -// ValidatorAccumulatedCommission represents accumulated commission -// for a validator kept as a running counter, can be withdrawn at any time. -message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -// for a validator inexpensive to track, allows simple sanity checks. -message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// ValidatorSlashEvent represents a validator slash event. -// Height is implicit within the store key. -// This is needed to calculate appropriate amount of staking tokens -// for delegations which are withdrawn after a slash has occurred. -message ValidatorSlashEvent { - uint64 validator_period = 1; - string fraction = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. -message ValidatorSlashEvents { - option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// FeePool is the global fee pool for distribution. -message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; -} - -// CommunityPoolSpendProposal details a proposal for use of community funds, -// together with how many coins are proposed to be spent, and to which -// recipient account. -// -// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no -// longer a need for an explicit CommunityPoolSpendProposal. To spend community -// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov -// module via a v1 governance proposal. -message CommunityPoolSpendProposal { - option deprecated = true; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - string title = 1; - string description = 2; - string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// DelegatorStartingInfo represents the starting info for a delegator reward -// period. It tracks the previous validator period, the delegation's amount of -// staking token, and the creation height (to check later on if any slashes have -// occurred). NOTE: Even though validators are slashed to whole staking tokens, -// the delegators within the validator may be left with less than a full token, -// thus sdk.Dec is used. -message DelegatorStartingInfo { - uint64 previous_period = 1; - string stake = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - uint64 height = 3 - [(gogoproto.jsontag) = "creation_height", (amino.field_name) = "creation_height", (amino.dont_omitempty) = true]; -} - -// DelegationDelegatorReward represents the properties -// of a delegator's delegation reward. -message DelegationDelegatorReward { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - repeated cosmos.base.v1beta1.DecCoin reward = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -// with a deposit -message CommunityPoolSpendProposalWithDeposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - - string title = 1; - string description = 2; - string recipient = 3; - string amount = 4; - string deposit = 5; -} diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto deleted file mode 100644 index 5bf2d6bb..00000000 --- a/proto/cosmos/distribution/v1beta1/genesis.proto +++ /dev/null @@ -1,155 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// DelegatorWithdrawInfo is the address for where distributions rewards are -// withdrawn to by default this struct is only used at genesis to feed in -// default withdraw addresses. -message DelegatorWithdrawInfo { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // withdraw_address is the address to withdraw the delegation rewards to. - string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. -message ValidatorOutstandingRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // outstanding_rewards represents the outstanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// ValidatorAccumulatedCommissionRecord is used for import / export via genesis -// json. -message ValidatorAccumulatedCommissionRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ValidatorHistoricalRewardsRecord is used for import / export via genesis -// json. -message ValidatorHistoricalRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // period defines the period the historical rewards apply to. - uint64 period = 2; - - // rewards defines the historical rewards of a validator. - ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ValidatorCurrentRewardsRecord is used for import / export via genesis json. -message ValidatorCurrentRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // rewards defines the current rewards of a validator. - ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// DelegatorStartingInfoRecord used for import / export via genesis json. -message DelegatorStartingInfoRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // validator_address is the address of the validator. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ValidatorSlashEventRecord is used for import / export via genesis json. -message ValidatorSlashEventRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // height defines the block height at which the slash event occurred. - uint64 height = 2; - // period is the period of the slash event. - uint64 period = 3; - // validator_slash_event describes the slash event. - ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// GenesisState defines the distribution module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the fee pool at genesis. - FeePool fee_pool = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the previous proposer at genesis. - string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the accumulated commissions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/distribution/v1beta1/query.proto b/proto/cosmos/distribution/v1beta1/query.proto deleted file mode 100644 index 4788467d..00000000 --- a/proto/cosmos/distribution/v1beta1/query.proto +++ /dev/null @@ -1,256 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; - -// Query defines the gRPC querier service for distribution module. -service Query { - // Params queries params of the distribution module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; - } - - // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator - rpc ValidatorDistributionInfo(QueryValidatorDistributionInfoRequest) - returns (QueryValidatorDistributionInfoResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}"; - } - - // ValidatorOutstandingRewards queries rewards of a validator address. - rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) - returns (QueryValidatorOutstandingRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/outstanding_rewards"; - } - - // ValidatorCommission queries accumulated commission for a validator. - rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/commission"; - } - - // ValidatorSlashes queries slash events of a validator. - rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; - } - - // DelegationRewards queries the total rewards accrued by a delegation. - rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" - "{validator_address}"; - } - - // DelegationTotalRewards queries the total rewards accrued by a each - // validator. - rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; - } - - // DelegatorValidators queries the validators of a delegator. - rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/validators"; - } - - // DelegatorWithdrawAddress queries withdraw address of a delegator. - rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/withdraw_address"; - } - - // CommunityPool queries the community pool coins. - rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. -message QueryValidatorDistributionInfoRequest { - // validator_address defines the validator address to query for. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. -message QueryValidatorDistributionInfoResponse { - // operator_address defines the validator operator address. - string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // self_bond_rewards defines the self delegations rewards. - repeated cosmos.base.v1beta1.DecCoin self_bond_rewards = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; - // commission defines the commission the validator received. - repeated cosmos.base.v1beta1.DecCoin commission = 3 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// QueryValidatorOutstandingRewardsRequest is the request type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsRequest { - // validator_address defines the validator address to query for. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryValidatorOutstandingRewardsResponse is the response type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsResponse { - ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryValidatorCommissionRequest is the request type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionRequest { - // validator_address defines the validator address to query for. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryValidatorCommissionResponse is the response type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionResponse { - // commission defines the commission the validator received. - ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryValidatorSlashesRequest is the request type for the -// Query/ValidatorSlashes RPC method -message QueryValidatorSlashesRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - // validator_address defines the validator address to query for. - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // starting_height defines the optional starting height to query the slashes. - uint64 starting_height = 2; - // starting_height defines the optional ending height to query the slashes. - uint64 ending_height = 3; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryValidatorSlashesResponse is the response type for the -// Query/ValidatorSlashes RPC method. -message QueryValidatorSlashesResponse { - // slashes defines the slashes the validator received. - repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegationRewardsRequest is the request type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_address defines the validator address to query for. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegationRewardsResponse is the response type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsResponse { - // rewards defines the rewards accrued by a delegation. - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; -} - -// QueryDelegationTotalRewardsRequest is the request type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // delegator_address defines the delegator address to query for. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegationTotalRewardsResponse is the response type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsResponse { - // rewards defines all the rewards accrued by a delegator. - repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // total defines the sum of all the rewards. - repeated cosmos.base.v1beta1.DecCoin total = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; -} - -// QueryDelegatorValidatorsRequest is the request type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegatorValidatorsResponse is the response type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validators defines the validators a delegator is delegating for. - repeated string validators = 1; -} - -// QueryDelegatorWithdrawAddressRequest is the request type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegatorWithdrawAddressResponse is the response type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // withdraw_address defines the delegator address to query for. - string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC -// method. -message QueryCommunityPoolRequest {} - -// QueryCommunityPoolResponse is the response type for the Query/CommunityPool -// RPC method. -message QueryCommunityPoolResponse { - // pool defines community pool's coins. - repeated cosmos.base.v1beta1.DecCoin pool = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto deleted file mode 100644 index 957747cf..00000000 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ /dev/null @@ -1,178 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; - -// Msg defines the distribution Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // SetWithdrawAddress defines a method to change the withdraw address - // for a delegator (or validator self-delegation). - rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); - - // WithdrawDelegatorReward defines a method to withdraw rewards of delegator - // from a single validator. - rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); - - // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address. - rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); - - // FundCommunityPool defines a method to allow an account to directly - // fund the community pool. - rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); - - // UpdateParams defines a governance operation for updating the x/distribution - // module parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - - // CommunityPoolSpend defines a governance operation for sending tokens from - // the community pool in the x/distribution module to another account, which - // could be the governance module itself. The authority is defined in the - // keeper. - // - // Since: cosmos-sdk 0.47 - rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); -} - -// MsgSetWithdrawAddress sets the withdraw address for -// a delegator (or validator self-delegation). -message MsgSetWithdrawAddress { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgModifyWithdrawAddress"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response -// type. -message MsgSetWithdrawAddressResponse {} - -// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator -// from a single validator. -message MsgWithdrawDelegatorReward { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgWithdrawDelegationReward"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward -// response type. -message MsgWithdrawDelegatorRewardResponse { - // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgWithdrawValidatorCommission withdraws the full commission to the validator -// address. -message MsgWithdrawValidatorCommission { - option (cosmos.msg.v1.signer) = "validator_address"; - option (amino.name) = "cosmos-sdk/MsgWithdrawValCommission"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgWithdrawValidatorCommissionResponse defines the -// Msg/WithdrawValidatorCommission response type. -message MsgWithdrawValidatorCommissionResponse { - // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgFundCommunityPool allows an account to directly -// fund the community pool. -message MsgFundCommunityPool { - option (cosmos.msg.v1.signer) = "depositor"; - option (amino.name) = "cosmos-sdk/MsgFundCommunityPool"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. -message MsgFundCommunityPoolResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/distribution/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/distribution parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} - -// MsgCommunityPoolSpend defines a message for sending tokens from the community -// pool to another account. This message is typically executed via a governance -// proposal with the governance module being the executing authority. -// -// Since: cosmos-sdk 0.47 -message MsgCommunityPoolSpend { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string recipient = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgCommunityPoolSpendResponse defines the response to executing a -// MsgCommunityPoolSpend message. -// -// Since: cosmos-sdk 0.47 -message MsgCommunityPoolSpendResponse {} diff --git a/proto/cosmos/evidence/module/v1/module.proto b/proto/cosmos/evidence/module/v1/module.proto deleted file mode 100644 index fceea7da..00000000 --- a/proto/cosmos/evidence/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.evidence.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the evidence module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/evidence" - }; -} \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/evidence.proto b/proto/cosmos/evidence/v1beta1/evidence.proto deleted file mode 100644 index 8dca3201..00000000 --- a/proto/cosmos/evidence/v1beta1/evidence.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos_proto/cosmos.proto"; - -// Equivocation implements the Evidence interface and defines evidence of double -// signing misbehavior. -message Equivocation { - option (amino.name) = "cosmos-sdk/Equivocation"; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - // height is the equivocation height. - int64 height = 1; - - // time is the equivocation time. - google.protobuf.Timestamp time = 2 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - - // power is the equivocation validator power. - int64 power = 3; - - // consensus_address is the equivocation validator consensus address. - string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/genesis.proto b/proto/cosmos/evidence/v1beta1/genesis.proto deleted file mode 100644 index 199f446f..00000000 --- a/proto/cosmos/evidence/v1beta1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -import "google/protobuf/any.proto"; - -// GenesisState defines the evidence module's genesis state. -message GenesisState { - // evidence defines all the evidence at genesis. - repeated google.protobuf.Any evidence = 1; -} diff --git a/proto/cosmos/evidence/v1beta1/query.proto b/proto/cosmos/evidence/v1beta1/query.proto deleted file mode 100644 index 34163dd5..00000000 --- a/proto/cosmos/evidence/v1beta1/query.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -// Query defines the gRPC querier service. -service Query { - // Evidence queries evidence based on evidence hash. - rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{hash}"; - } - - // AllEvidence queries all evidence. - rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; - } -} - -// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. -message QueryEvidenceRequest { - // evidence_hash defines the hash of the requested evidence. - // Deprecated: Use hash, a HEX encoded string, instead. - bytes evidence_hash = 1 - [deprecated = true, (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; - - // hash defines the evidence hash of the requested evidence. - // - // Since: cosmos-sdk 0.47 - string hash = 2; -} - -// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. -message QueryEvidenceResponse { - // evidence returns the requested evidence. - google.protobuf.Any evidence = 1; -} - -// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceResponse { - // evidence returns all evidences. - repeated google.protobuf.Any evidence = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto deleted file mode 100644 index f5646e2d..00000000 --- a/proto/cosmos/evidence/v1beta1/tx.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -// Msg defines the evidence Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - // counterfactual signing. - rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); -} - -// MsgSubmitEvidence represents a message that supports submitting arbitrary -// Evidence of misbehavior such as equivocation or counterfactual signing. -message MsgSubmitEvidence { - option (cosmos.msg.v1.signer) = "submitter"; - option (amino.name) = "cosmos-sdk/MsgSubmitEvidence"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // submitter is the signer account address of evidence. - string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // evidence defines the evidence of misbehavior. - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"]; -} - -// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. -message MsgSubmitEvidenceResponse { - // hash defines the hash of the evidence. - bytes hash = 4; -} diff --git a/proto/cosmos/feegrant/module/v1/module.proto b/proto/cosmos/feegrant/module/v1/module.proto deleted file mode 100644 index d838f02f..00000000 --- a/proto/cosmos/feegrant/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.feegrant.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the feegrant module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/feegrant" - }; -} \ No newline at end of file diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto deleted file mode 100644 index 1cfe741b..00000000 --- a/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ /dev/null @@ -1,93 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "amino/amino.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// BasicAllowance implements Allowance with a one-time grant of coins -// that optionally expires. The grantee can use up to SpendLimit to cover fees. -message BasicAllowance { - option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; - option (amino.name) = "cosmos-sdk/BasicAllowance"; - - // spend_limit specifies the maximum amount of coins that can be spent - // by this allowance and will be updated as coins are spent. If it is - // empty, there is no spend limit and any amount of coins can be spent. - repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // expiration specifies an optional time when this allowance expires - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; -} - -// PeriodicAllowance extends Allowance to allow for both a maximum cap, -// as well as a limit per time period. -message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; - option (amino.name) = "cosmos-sdk/PeriodicAllowance"; - - // basic specifies a struct of `BasicAllowance` - BasicAllowance basic = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // period specifies the time duration in which period_spend_limit coins can - // be spent before that allowance is reset - google.protobuf.Duration period = 2 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // period_spend_limit specifies the maximum number of coins that can be spent - // in the period - repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // period_can_spend is the number of coins left to be spent before the period_reset time - repeated cosmos.base.v1beta1.Coin period_can_spend = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // period_reset is the time at which this period resets and a new one begins, - // it is calculated from the start time of the first transaction after the - // last period ended - google.protobuf.Timestamp period_reset = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// AllowedMsgAllowance creates allowance only for specified message types. -message AllowedMsgAllowance { - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; - option (amino.name) = "cosmos-sdk/AllowedMsgAllowance"; - - // allowance can be any of basic and periodic fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; - - // allowed_messages are the messages for which the grantee has the access. - repeated string allowed_messages = 2; -} - -// Grant is stored in the KVStore to record a grant with full context -message Grant { - // granter is the address of the user granting an allowance of their funds. - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; -} diff --git a/proto/cosmos/feegrant/v1beta1/genesis.proto b/proto/cosmos/feegrant/v1beta1/genesis.proto deleted file mode 100644 index a1ead956..00000000 --- a/proto/cosmos/feegrant/v1beta1/genesis.proto +++ /dev/null @@ -1,14 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/feegrant/v1beta1/feegrant.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// GenesisState contains a set of fee allowances, persisted from the store -message GenesisState { - repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto deleted file mode 100644 index baef7770..00000000 --- a/proto/cosmos/feegrant/v1beta1/query.proto +++ /dev/null @@ -1,84 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "cosmos/feegrant/v1beta1/feegrant.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Query defines the gRPC querier service. -service Query { - - // Allowance returns fee granted to the grantee by the granter. - rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; - } - - // Allowances returns all the grants for address. - rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; - } - - // AllowancesByGranter returns all the grants given by an address - // - // Since: cosmos-sdk 0.46 - rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; - } -} - -// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. -message QueryAllowanceRequest { - // granter is the address of the user granting an allowance of their funds. - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. -message QueryAllowanceResponse { - // allowance is a allowance granted for grantee by granter. - cosmos.feegrant.v1beta1.Grant allowance = 1; -} - -// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. -message QueryAllowancesRequest { - string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. -message QueryAllowancesResponse { - // allowances are allowance's granted for grantee by granter. - repeated cosmos.feegrant.v1beta1.Grant allowances = 1; - - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 -message QueryAllowancesByGranterRequest { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 -message QueryAllowancesByGranterResponse { - // allowances that have been issued by the granter. - repeated cosmos.feegrant.v1beta1.Grant allowances = 1; - - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto deleted file mode 100644 index 20bbaf48..00000000 --- a/proto/cosmos/feegrant/v1beta1/tx.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Msg defines the feegrant msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // GrantAllowance grants fee allowance to the grantee on the granter's - // account with the provided expiration time. - rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); - - // RevokeAllowance revokes any fee allowance of granter's account that - // has been granted to the grantee. - rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); -} - -// MsgGrantAllowance adds permission for Grantee to spend up to Allowance -// of fees from the account of Granter. -message MsgGrantAllowance { - option (cosmos.msg.v1.signer) = "granter"; - option (amino.name) = "cosmos-sdk/MsgGrantAllowance"; - - // granter is the address of the user granting an allowance of their funds. - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; -} - -// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. -message MsgGrantAllowanceResponse {} - -// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. -message MsgRevokeAllowance { - option (cosmos.msg.v1.signer) = "granter"; - option (amino.name) = "cosmos-sdk/MsgRevokeAllowance"; - - // granter is the address of the user granting an allowance of their funds. - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. -message MsgRevokeAllowanceResponse {} diff --git a/proto/cosmos/genutil/module/v1/module.proto b/proto/cosmos/genutil/module/v1/module.proto deleted file mode 100644 index 86e6f576..00000000 --- a/proto/cosmos/genutil/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.genutil.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object for the genutil module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/genutil" - }; -} \ No newline at end of file diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto deleted file mode 100644 index 45aa6bb2..00000000 --- a/proto/cosmos/genutil/v1beta1/genesis.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; -package cosmos.genutil.v1beta1; - -import "gogoproto/gogo.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; - -// GenesisState defines the raw genesis transaction in JSON. -message GenesisState { - // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [ - (gogoproto.casttype) = "encoding/json.RawMessage", - (gogoproto.jsontag) = "gentxs", - (amino.field_name) = "gentxs", - (amino.dont_omitempty) = true - ]; -} diff --git a/proto/cosmos/gov/module/v1/module.proto b/proto/cosmos/gov/module/v1/module.proto deleted file mode 100644 index 9544cfe2..00000000 --- a/proto/cosmos/gov/module/v1/module.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package cosmos.gov.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the gov module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/gov" - }; - - // max_metadata_len defines the maximum proposal metadata length. - // Defaults to 255 if not explicitly set. - uint64 max_metadata_len = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} \ No newline at end of file diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto deleted file mode 100644 index b9cf573f..00000000 --- a/proto/cosmos/gov/v1/genesis.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.gov.v1; - -import "cosmos/gov/v1/gov.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; - -// GenesisState defines the gov module's genesis state. -message GenesisState { - // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1; - // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2; - // votes defines all the votes present at genesis. - repeated Vote votes = 3; - // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4; - // Deprecated: Prefer to use `params` instead. - // deposit_params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [deprecated = true]; - // Deprecated: Prefer to use `params` instead. - // voting_params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [deprecated = true]; - // Deprecated: Prefer to use `params` instead. - // tally_params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [deprecated = true]; - // params defines all the paramaters of x/gov module. - // - // Since: cosmos-sdk 0.47 - Params params = 8; -} diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto deleted file mode 100644 index 49bfcc26..00000000 --- a/proto/cosmos/gov/v1/gov.proto +++ /dev/null @@ -1,220 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.gov.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; - -// VoteOption enumerates the valid vote options for a given governance proposal. -enum VoteOption { - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VOTE_OPTION_UNSPECIFIED = 0; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4; -} - -// WeightedVoteOption defines a unit of vote for vote split. -message WeightedVoteOption { - // option defines the valid vote options, it must not contain duplicate vote options. - VoteOption option = 1; - - // weight is the vote weight associated with the vote option. - string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -message Deposit { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // amount to be deposited by depositor. - repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// Proposal defines the core field members of a governance proposal. -message Proposal { - // id defines the unique id of the proposal. - uint64 id = 1; - - // messages are the arbitrary messages to be executed if the proposal passes. - repeated google.protobuf.Any messages = 2; - - // status defines the proposal status. - ProposalStatus status = 3; - - // final_tally_result is the final tally result of the proposal. When - // querying a proposal via gRPC, this field is not populated until the - // proposal's voting period has ended. - TallyResult final_tally_result = 4; - - // submit_time is the time of proposal submission. - google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; - - // deposit_end_time is the end time for deposition. - google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; - - // total_deposit is the total deposit on the proposal. - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // voting_start_time is the starting time to vote on a proposal. - google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; - - // voting_end_time is the end time of voting on a proposal. - google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; - - // metadata is any arbitrary metadata attached to the proposal. - string metadata = 10; - - // title is the title of the proposal - // - // Since: cosmos-sdk 0.47 - string title = 11; - - // summary is a short summary of the proposal - // - // Since: cosmos-sdk 0.47 - string summary = 12; - - // Proposer is the address of the proposal sumbitter - // - // Since: cosmos-sdk 0.47 - string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// ProposalStatus enumerates the valid statuses of a proposal. -enum ProposalStatus { - // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - PROPOSAL_STATUS_UNSPECIFIED = 0; - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1; - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - PROPOSAL_STATUS_VOTING_PERIOD = 2; - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - PROPOSAL_STATUS_PASSED = 3; - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - PROPOSAL_STATUS_REJECTED = 4; - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - PROPOSAL_STATUS_FAILED = 5; -} - -// TallyResult defines a standard tally for a governance proposal. -message TallyResult { - // yes_count is the number of yes votes on a proposal. - string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; - // abstain_count is the number of abstain votes on a proposal. - string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; - // no_count is the number of no votes on a proposal. - string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; - // no_with_veto_count is the number of no with veto votes on a proposal. - string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -message Vote { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter is the voter address of the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - reserved 3; - - // options is the weighted vote options. - repeated WeightedVoteOption options = 4; - - // metadata is any arbitrary metadata to attached to the vote. - string metadata = 5; -} - -// DepositParams defines the params for deposits on governance proposals. -message DepositParams { - // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; - - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - google.protobuf.Duration max_deposit_period = 2 - [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; -} - -// VotingParams defines the params for voting on governance proposals. -message VotingParams { - // Duration of the voting period. - google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; -} - -// TallyParams defines the params for tallying votes on governance proposals. -message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; -} - -// Params defines the parameters for the x/gov module. -// -// Since: cosmos-sdk 0.47 -message Params { - // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; - - // Duration of the voting period. - google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; - - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. - string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // burn deposits if a proposal does not meet quorum - bool burn_vote_quorum = 13; - - // burn deposits if the proposal does not enter voting period - bool burn_proposal_deposit_prevote = 14; - - // burn deposits if quorum with vote type no_veto is met - bool burn_vote_veto = 15; -} diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto deleted file mode 100644 index 0c1c9f2b..00000000 --- a/proto/cosmos/gov/v1/query.proto +++ /dev/null @@ -1,193 +0,0 @@ - -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.gov.v1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; -import "cosmos/gov/v1/gov.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; - -// Query defines the gRPC querier service for gov module -service Query { - // Proposal queries proposal details based on ProposalID. - rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; - } - - // Proposals queries all proposals based on given status. - rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals"; - } - - // Vote queries voted information based on proposalID, voterAddr. - rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; - } - - // Votes queries votes of a given proposal. - rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; - } - - // Params queries all parameters of the gov module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; - } - - // Deposit queries single deposit information based proposalID, depositAddr. - rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; - } - - // Deposits queries all deposits of a single proposal. - rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; - } - - // TallyResult queries the tally of a proposal vote. - rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; - } -} - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -message QueryProposalRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -message QueryProposalResponse { - // proposal is the requested governance proposal. - Proposal proposal = 1; -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -message QueryProposalsRequest { - // proposal_status defines the status of the proposals. - ProposalStatus proposal_status = 1; - - // voter defines the voter address for the proposals. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // depositor defines the deposit addresses from the proposals. - string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -message QueryProposalsResponse { - // proposals defines all the requested governance proposals. - repeated Proposal proposals = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -message QueryVoteRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter defines the voter address for the proposals. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -message QueryVoteResponse { - // vote defines the queried vote. - Vote vote = 1; -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -message QueryVotesRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -message QueryVotesResponse { - // votes defines the queried votes. - repeated Vote votes = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - string params_type = 1; -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // Deprecated: Prefer to use `params` instead. - // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [deprecated = true]; - // Deprecated: Prefer to use `params` instead. - // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [deprecated = true]; - // Deprecated: Prefer to use `params` instead. - // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [deprecated = true]; - // params defines all the paramaters of x/gov module. - // - // Since: cosmos-sdk 0.47 - Params params = 4; -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -message QueryDepositRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -message QueryDepositResponse { - // deposit defines the requested deposit. - Deposit deposit = 1; -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -message QueryDepositsRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -message QueryDepositsResponse { - // deposits defines the requested deposits. - repeated Deposit deposits = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -message QueryTallyResultRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -message QueryTallyResultResponse { - // tally defines the requested tally. - TallyResult tally = 1; -} diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto deleted file mode 100644 index 1708066c..00000000 --- a/proto/cosmos/gov/v1/tx.proto +++ /dev/null @@ -1,172 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.gov.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1/gov.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/any.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; - -// Msg defines the gov Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // SubmitProposal defines a method to create new proposal given the messages. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - // to execute a legacy content-based proposal. - rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); - - // Vote defines a method to add a vote on a specific proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); - - // Deposit defines a method to add deposit on a specific proposal. - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); - - // UpdateParams defines a governance operation for updating the x/gov module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -message MsgSubmitProposal { - option (cosmos.msg.v1.signer) = "proposer"; - option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal"; - - // messages are the arbitrary messages to be executed if proposal passes. - repeated google.protobuf.Any messages = 1; - - // initial_deposit is the deposit value that must be paid at proposal submission. - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // proposer is the account address of the proposer. - string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // metadata is any arbitrary metadata attached to the proposal. - string metadata = 4; - - // title is the title of the proposal. - // - // Since: cosmos-sdk 0.47 - string title = 5; - - // summary is the summary of the proposal - // - // Since: cosmos-sdk 0.47 - string summary = 6; -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// MsgExecLegacyContent is used to wrap the legacy content field into a message. -// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. -message MsgExecLegacyContent { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/v1/MsgExecLegacyContent"; - - // content is the proposal's content. - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; - // authority must be the gov module address. - string authority = 2; -} - -// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. -message MsgExecLegacyContentResponse {} - -// MsgVote defines a message to cast a vote. -message MsgVote { - option (cosmos.msg.v1.signer) = "voter"; - option (amino.name) = "cosmos-sdk/v1/MsgVote"; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; - - // voter is the voter address for the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // option defines the vote option. - VoteOption option = 3; - - // metadata is any arbitrary metadata attached to the Vote. - string metadata = 4; -} - -// MsgVoteResponse defines the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgVoteWeighted defines a message to cast a vote. -message MsgVoteWeighted { - option (cosmos.msg.v1.signer) = "voter"; - option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted"; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; - - // voter is the voter address for the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // options defines the weighted vote options. - repeated WeightedVoteOption options = 3; - - // metadata is any arbitrary metadata attached to the VoteWeighted. - string metadata = 4; -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -message MsgVoteWeightedResponse {} - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -message MsgDeposit { - option (cosmos.msg.v1.signer) = "depositor"; - option (amino.name) = "cosmos-sdk/v1/MsgDeposit"; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // amount to be deposited by depositor. - repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgDepositResponse defines the Msg/Deposit response type. -message MsgDepositResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/gov/v1/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/gov parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto deleted file mode 100644 index a680590c..00000000 --- a/proto/cosmos/gov/v1beta1/genesis.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package cosmos.gov.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; - -// GenesisState defines the gov module's genesis state. -message GenesisState { - // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1; - // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2 - [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // votes defines all the votes present at genesis. - repeated Vote votes = 3 - [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4 - [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto deleted file mode 100644 index dc8fcfd3..00000000 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ /dev/null @@ -1,252 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; - -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// VoteOption enumerates the valid vote options for a given governance proposal. -enum VoteOption { - option (gogoproto.goproto_enum_prefix) = false; - - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; -} - -// WeightedVoteOption defines a unit of vote for vote split. -// -// Since: cosmos-sdk 0.43 -message WeightedVoteOption { - // option defines the valid vote options, it must not contain duplicate vote options. - VoteOption option = 1; - - // weight is the vote weight associated with the vote option. - string weight = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval. -message TextProposal { - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - option (amino.name) = "cosmos-sdk/TextProposal"; - - option (gogoproto.equal) = true; - - // title of the proposal. - string title = 1; - - // description associated with the proposal. - string description = 2; -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -message Deposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // amount to be deposited by depositor. - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// Proposal defines the core field members of a governance proposal. -message Proposal { - option (gogoproto.equal) = true; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // content is the proposal's content. - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; - // status defines the proposal status. - ProposalStatus status = 3; - - // final_tally_result is the final tally result of the proposal. When - // querying a proposal via gRPC, this field is not populated until the - // proposal's voting period has ended. - TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // submit_time is the time of proposal submission. - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // deposit_end_time is the end time for deposition. - google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // total_deposit is the total deposit on the proposal. - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // voting_start_time is the starting time to vote on a proposal. - google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // voting_end_time is the end time of voting on a proposal. - google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ProposalStatus enumerates the valid statuses of a proposal. -enum ProposalStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; -} - -// TallyResult defines a standard tally for a governance proposal. -message TallyResult { - option (gogoproto.equal) = true; - - // yes is the number of yes votes on a proposal. - string yes = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // abstain is the number of abstain votes on a proposal. - string abstain = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // no is the number of no votes on a proposal. - string no = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // no_with_veto is the number of no with veto votes on a proposal. - string no_with_veto = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -message Vote { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true]; - - // voter is the voter address of the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Deprecated: Prefer to use `options` instead. This field is set in queries - // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - VoteOption option = 3 [deprecated = true]; - - // options is the weighted vote options. - // - // Since: cosmos-sdk 0.43 - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// DepositParams defines the params for deposits on governance proposals. -message DepositParams { - // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.jsontag) = "min_deposit,omitempty" - ]; - - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - google.protobuf.Duration max_deposit_period = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "max_deposit_period,omitempty" - ]; -} - -// VotingParams defines the params for voting on governance proposals. -message VotingParams { - // Duration of the voting period. - google.protobuf.Duration voting_period = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; -} - -// TallyParams defines the params for tallying votes on governance proposals. -message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quorum,omitempty" - ]; - - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "threshold,omitempty" - ]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "veto_threshold,omitempty" - ]; -} diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto deleted file mode 100644 index f225a0f6..00000000 --- a/proto/cosmos/gov/v1beta1/query.proto +++ /dev/null @@ -1,194 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; - -// Query defines the gRPC querier service for gov module -service Query { - // Proposal queries proposal details based on ProposalID. - rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; - } - - // Proposals queries all proposals based on given status. - rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; - } - - // Vote queries voted information based on proposalID, voterAddr. - rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; - } - - // Votes queries votes of a given proposal. - rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; - } - - // Params queries all parameters of the gov module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; - } - - // Deposit queries single deposit information based proposalID, depositAddr. - rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; - } - - // Deposits queries all deposits of a single proposal. - rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; - } - - // TallyResult queries the tally of a proposal vote. - rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; - } -} - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -message QueryProposalRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -message QueryProposalResponse { - Proposal proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -message QueryProposalsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_status defines the status of the proposals. - ProposalStatus proposal_status = 1; - - // voter defines the voter address for the proposals. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // depositor defines the deposit addresses from the proposals. - string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -message QueryProposalsResponse { - // proposals defines all the requested governance proposals. - repeated Proposal proposals = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -message QueryVoteRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter defines the voter address for the proposals. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -message QueryVoteResponse { - // vote defines the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -message QueryVotesRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -message QueryVotesResponse { - // votes defines the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - string params_type = 1; -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -message QueryDepositRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -message QueryDepositResponse { - // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -message QueryDepositsRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -message QueryDepositsResponse { - // deposits defines the requested deposits. - repeated Deposit deposits = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -message QueryTallyResultRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -message QueryTallyResultResponse { - // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto deleted file mode 100644 index 0afa1d56..00000000 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; - -// Msg defines the bank Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // SubmitProposal defines a method to create new proposal given a content. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // Vote defines a method to add a vote on a specific proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); - - // Deposit defines a method to add deposit on a specific proposal. - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); -} - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -message MsgSubmitProposal { - option (cosmos.msg.v1.signer) = "proposer"; - option (amino.name) = "cosmos-sdk/MsgSubmitProposal"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // content is the proposal's content. - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; - // initial_deposit is the deposit value that must be paid at proposal submission. - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // proposer is the account address of the proposer. - string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; -} - -// MsgVote defines a message to cast a vote. -message MsgVote { - option (cosmos.msg.v1.signer) = "voter"; - option (amino.name) = "cosmos-sdk/MsgVote"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter is the voter address for the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // option defines the vote option. - VoteOption option = 3; -} - -// MsgVoteResponse defines the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeighted { - option (cosmos.msg.v1.signer) = "voter"; - option (amino.name) = "cosmos-sdk/MsgVoteWeighted"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; - - // voter is the voter address for the proposal. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // options defines the weighted vote options. - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeightedResponse {} - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -message MsgDeposit { - option (cosmos.msg.v1.signer) = "depositor"; - option (amino.name) = "cosmos-sdk/MsgDeposit"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // amount to be deposited by depositor. - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgDepositResponse defines the Msg/Deposit response type. -message MsgDepositResponse {} diff --git a/proto/cosmos/group/module/v1/module.proto b/proto/cosmos/group/module/v1/module.proto deleted file mode 100644 index d1e7ffb2..00000000 --- a/proto/cosmos/group/module/v1/module.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; - -package cosmos.group.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "amino/amino.proto"; - -// Module is the config object of the group module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/group" - }; - - // max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec - // to execute the proposal. - google.protobuf.Duration max_execution_period = 1 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. - // Defaults to 255 if not explicitly set. - uint64 max_metadata_len = 2; -} diff --git a/proto/cosmos/group/v1/events.proto b/proto/cosmos/group/v1/events.proto deleted file mode 100644 index 2b98ec9a..00000000 --- a/proto/cosmos/group/v1/events.proto +++ /dev/null @@ -1,94 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.group.v1; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/group/v1/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/group"; - -// EventCreateGroup is an event emitted when a group is created. -message EventCreateGroup { - - // group_id is the unique ID of the group. - uint64 group_id = 1; -} - -// EventUpdateGroup is an event emitted when a group is updated. -message EventUpdateGroup { - - // group_id is the unique ID of the group. - uint64 group_id = 1; -} - -// EventCreateGroupPolicy is an event emitted when a group policy is created. -message EventCreateGroupPolicy { - - // address is the account address of the group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// EventUpdateGroupPolicy is an event emitted when a group policy is updated. -message EventUpdateGroupPolicy { - - // address is the account address of the group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// EventSubmitProposal is an event emitted when a proposal is created. -message EventSubmitProposal { - - // proposal_id is the unique ID of the proposal. - uint64 proposal_id = 1; -} - -// EventWithdrawProposal is an event emitted when a proposal is withdrawn. -message EventWithdrawProposal { - - // proposal_id is the unique ID of the proposal. - uint64 proposal_id = 1; -} - -// EventVote is an event emitted when a voter votes on a proposal. -message EventVote { - - // proposal_id is the unique ID of the proposal. - uint64 proposal_id = 1; -} - -// EventExec is an event emitted when a proposal is executed. -message EventExec { - - // proposal_id is the unique ID of the proposal. - uint64 proposal_id = 1; - - // result is the proposal execution result. - ProposalExecutorResult result = 2; - - // logs contains error logs in case the execution result is FAILURE. - string logs = 3; -} - -// EventLeaveGroup is an event emitted when group member leaves the group. -message EventLeaveGroup { - - // group_id is the unique ID of the group. - uint64 group_id = 1; - - // address is the account address of the group member. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// EventProposalPruned is an event emitted when a proposal is pruned. -message EventProposalPruned { - - // proposal_id is the unique ID of the proposal. - uint64 proposal_id = 1; - - // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). - ProposalStatus status = 2; - - // tally_result is the proposal tally result (when applicable). - TallyResult tally_result = 3; -} diff --git a/proto/cosmos/group/v1/genesis.proto b/proto/cosmos/group/v1/genesis.proto deleted file mode 100644 index e4c895e9..00000000 --- a/proto/cosmos/group/v1/genesis.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.group.v1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/group"; - -import "cosmos/group/v1/types.proto"; - -// GenesisState defines the group module's genesis state. -message GenesisState { - - // group_seq is the group table orm.Sequence, - // it is used to get the next group ID. - uint64 group_seq = 1; - - // groups is the list of groups info. - repeated GroupInfo groups = 2; - - // group_members is the list of groups members. - repeated GroupMember group_members = 3; - - // group_policy_seq is the group policy table orm.Sequence, - // it is used to generate the next group policy account address. - uint64 group_policy_seq = 4; - - // group_policies is the list of group policies info. - repeated GroupPolicyInfo group_policies = 5; - - // proposal_seq is the proposal table orm.Sequence, - // it is used to get the next proposal ID. - uint64 proposal_seq = 6; - - // proposals is the list of proposals. - repeated Proposal proposals = 7; - - // votes is the list of votes. - repeated Vote votes = 8; -} \ No newline at end of file diff --git a/proto/cosmos/group/v1/query.proto b/proto/cosmos/group/v1/query.proto deleted file mode 100644 index 80b09255..00000000 --- a/proto/cosmos/group/v1/query.proto +++ /dev/null @@ -1,320 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.group.v1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/group/v1/types.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/group"; - -// Query is the cosmos.group.v1 Query service. -service Query { - - // GroupInfo queries group info based on group id. - rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) { - option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}"; - }; - - // GroupPolicyInfo queries group policy info based on account address of group policy. - rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) { - option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; - }; - - // GroupMembers queries members of a group by group id. - rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { - option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; - }; - - // GroupsByAdmin queries groups by admin address. - rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) { - option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}"; - }; - - // GroupPoliciesByGroup queries group policies by group id. - rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) { - option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; - }; - - // GroupPoliciesByAdmin queries group policies by admin address. - rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { - option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; - }; - - // Proposal queries a proposal based on proposal id. - rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}"; - }; - - // ProposalsByGroupPolicy queries proposals based on account address of group policy. - rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) { - option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}"; - }; - - // VoteByProposalVoter queries a vote by proposal id and voter. - rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) { - option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; - }; - - // VotesByProposal queries a vote by proposal id. - rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { - option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; - }; - - // VotesByVoter queries a vote by voter. - rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) { - option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}"; - }; - - // GroupsByMember queries groups by member address. - rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) { - option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; - }; - - // TallyResult returns the tally result of a proposal. If the proposal is - // still in voting period, then this query computes the current tally state, - // which might not be final. On the other hand, if the proposal is final, - // then it simply returns the `final_tally_result` state stored in the - // proposal itself. - rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; - }; - - // Groups queries all groups in state. - // - // Since: cosmos-sdk 0.47.1 - rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { - option (google.api.http).get = "/cosmos/group/v1/groups"; - }; -} - -// QueryGroupInfoRequest is the Query/GroupInfo request type. -message QueryGroupInfoRequest { - // group_id is the unique ID of the group. - uint64 group_id = 1; -} - -// QueryGroupInfoResponse is the Query/GroupInfo response type. -message QueryGroupInfoResponse { - // info is the GroupInfo of the group. - GroupInfo info = 1; -} - -// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. -message QueryGroupPolicyInfoRequest { - // address is the account address of the group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. -message QueryGroupPolicyInfoResponse { - // info is the GroupPolicyInfo of the group policy. - GroupPolicyInfo info = 1; -} - -// QueryGroupMembersRequest is the Query/GroupMembers request type. -message QueryGroupMembersRequest { - // group_id is the unique ID of the group. - uint64 group_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. -message QueryGroupMembersResponse { - // members are the members of the group with given group_id. - repeated GroupMember members = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. -message QueryGroupsByAdminRequest { - // admin is the account address of a group's admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. -message QueryGroupsByAdminResponse { - // groups are the groups info with the provided admin. - repeated GroupInfo groups = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. -message QueryGroupPoliciesByGroupRequest { - // group_id is the unique ID of the group policy's group. - uint64 group_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. -message QueryGroupPoliciesByGroupResponse { - // group_policies are the group policies info associated with the provided group. - repeated GroupPolicyInfo group_policies = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. -message QueryGroupPoliciesByAdminRequest { - // admin is the admin address of the group policy. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. -message QueryGroupPoliciesByAdminResponse { - // group_policies are the group policies info with provided admin. - repeated GroupPolicyInfo group_policies = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryProposalRequest is the Query/Proposal request type. -message QueryProposalRequest { - // proposal_id is the unique ID of a proposal. - uint64 proposal_id = 1; -} - -// QueryProposalResponse is the Query/Proposal response type. -message QueryProposalResponse { - // proposal is the proposal info. - Proposal proposal = 1; -} - -// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. -message QueryProposalsByGroupPolicyRequest { - // address is the account address of the group policy related to proposals. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. -message QueryProposalsByGroupPolicyResponse { - // proposals are the proposals with given group policy. - repeated Proposal proposals = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. -message QueryVoteByProposalVoterRequest { - // proposal_id is the unique ID of a proposal. - uint64 proposal_id = 1; - - // voter is a proposal voter account address. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. -message QueryVoteByProposalVoterResponse { - // vote is the vote with given proposal_id and voter. - Vote vote = 1; -} - -// QueryVotesByProposalRequest is the Query/VotesByProposal request type. -message QueryVotesByProposalRequest { - // proposal_id is the unique ID of a proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesByProposalResponse is the Query/VotesByProposal response type. -message QueryVotesByProposalResponse { - // votes are the list of votes for given proposal_id. - repeated Vote votes = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVotesByVoterRequest is the Query/VotesByVoter request type. -message QueryVotesByVoterRequest { - // voter is a proposal voter account address. - string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesByVoterResponse is the Query/VotesByVoter response type. -message QueryVotesByVoterResponse { - // votes are the list of votes by given voter. - repeated Vote votes = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. -message QueryGroupsByMemberRequest { - // address is the group member address. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. -message QueryGroupsByMemberResponse { - // groups are the groups info with the provided group member. - repeated GroupInfo groups = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTallyResultRequest is the Query/TallyResult request type. -message QueryTallyResultRequest { - // proposal_id is the unique id of a proposal. - uint64 proposal_id = 1; -} - -// QueryTallyResultResponse is the Query/TallyResult response type. -message QueryTallyResultResponse { - // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryGroupsRequest is the Query/Groups request type. -// -// Since: cosmos-sdk 0.47.1 -message QueryGroupsRequest { - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGroupsResponse is the Query/Groups response type. -// -// Since: cosmos-sdk 0.47.1 -message QueryGroupsResponse { - // `groups` is all the groups present in state. - repeated GroupInfo groups = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/group/v1/tx.proto b/proto/cosmos/group/v1/tx.proto deleted file mode 100644 index 20e04cb7..00000000 --- a/proto/cosmos/group/v1/tx.proto +++ /dev/null @@ -1,394 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.group.v1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/group"; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/any.proto"; -import "cosmos/group/v1/types.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -// Msg is the cosmos.group.v1 Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. - rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); - - // UpdateGroupMembers updates the group members with given group id and admin address. - rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse); - - // UpdateGroupAdmin updates the group admin with given group id and previous admin address. - rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse); - - // UpdateGroupMetadata updates the group metadata with given group id and admin address. - rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse); - - // CreateGroupPolicy creates a new group policy using given DecisionPolicy. - rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse); - - // CreateGroupWithPolicy creates a new group with policy. - rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse); - - // UpdateGroupPolicyAdmin updates a group policy admin. - rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse); - - // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. - rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy) - returns (MsgUpdateGroupPolicyDecisionPolicyResponse); - - // UpdateGroupPolicyMetadata updates a group policy metadata. - rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse); - - // SubmitProposal submits a new proposal. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // WithdrawProposal withdraws a proposal. - rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); - - // Vote allows a voter to vote on a proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // Exec executes a proposal. - rpc Exec(MsgExec) returns (MsgExecResponse); - - // LeaveGroup allows a group member to leave the group. - rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse); -} - -// -// Groups -// - -// MsgCreateGroup is the Msg/CreateGroup request type. -message MsgCreateGroup { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgCreateGroup"; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // members defines the group members. - repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // metadata is any arbitrary metadata to attached to the group. - string metadata = 3; -} - -// MsgCreateGroupResponse is the Msg/CreateGroup response type. -message MsgCreateGroupResponse { - // group_id is the unique ID of the newly created group. - uint64 group_id = 1; -} - -// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. -message MsgUpdateGroupMembers { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupMembers"; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; - - // member_updates is the list of members to update, - // set weight to 0 to remove a member. - repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. -message MsgUpdateGroupMembersResponse {} - -// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. -message MsgUpdateGroupAdmin { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupAdmin"; - - // admin is the current account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; - - // new_admin is the group new admin account address. - string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. -message MsgUpdateGroupAdminResponse {} - -// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. -message MsgUpdateGroupMetadata { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupMetadata"; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; - - // metadata is the updated group's metadata. - string metadata = 3; -} - -// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. -message MsgUpdateGroupMetadataResponse {} - -// -// Group Policies -// - -// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. -message MsgCreateGroupPolicy { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgCreateGroupPolicy"; - - option (gogoproto.goproto_getters) = false; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; - - // metadata is any arbitrary metadata attached to the group policy. - string metadata = 3; - - // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; -} - -// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. -message MsgCreateGroupPolicyResponse { - // address is the account address of the newly created group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. -message MsgUpdateGroupPolicyAdmin { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_policy_address is the account address of the group policy. - string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // new_admin is the new group policy admin. - string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. -message MsgUpdateGroupPolicyAdminResponse {} - -// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. -message MsgCreateGroupWithPolicy { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgCreateGroupWithPolicy"; - option (gogoproto.goproto_getters) = false; - - // admin is the account address of the group and group policy admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // members defines the group members. - repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // group_metadata is any arbitrary metadata attached to the group. - string group_metadata = 3; - - // group_policy_metadata is any arbitrary metadata attached to the group policy. - string group_policy_metadata = 4; - - // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group - // and group policy admin. - bool group_policy_as_admin = 5; - - // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; -} - -// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. -message MsgCreateGroupWithPolicyResponse { - // group_id is the unique ID of the newly created group with policy. - uint64 group_id = 1; - - // group_policy_address is the account address of the newly created group policy. - string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. -message MsgUpdateGroupPolicyDecisionPolicy { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; - - option (gogoproto.goproto_getters) = false; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_policy_address is the account address of group policy. - string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // decision_policy is the updated group policy's decision policy. - google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; -} - -// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. -message MsgUpdateGroupPolicyDecisionPolicyResponse {} - -// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. -message MsgUpdateGroupPolicyMetadata { - option (cosmos.msg.v1.signer) = "admin"; - option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; - - // admin is the account address of the group admin. - string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_policy_address is the account address of group policy. - string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // metadata is the group policy metadata to be updated. - string metadata = 3; -} - -// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. -message MsgUpdateGroupPolicyMetadataResponse {} - -// -// Proposals and Voting -// - -// Exec defines modes of execution of a proposal on creation or on new vote. -enum Exec { - // An empty value means that there should be a separate - // MsgExec request for the proposal to execute. - EXEC_UNSPECIFIED = 0; - - // Try to execute the proposal immediately. - // If the proposal is not allowed per the DecisionPolicy, - // the proposal will still be open and could - // be executed at a later point. - EXEC_TRY = 1; -} - -// MsgSubmitProposal is the Msg/SubmitProposal request type. -message MsgSubmitProposal { - option (cosmos.msg.v1.signer) = "proposers"; - option (amino.name) = "cosmos-sdk/group/MsgSubmitProposal"; - - option (gogoproto.goproto_getters) = false; - - // group_policy_address is the account address of group policy. - string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // proposers are the account addresses of the proposers. - // Proposers signatures will be counted as yes votes. - repeated string proposers = 2; - - // metadata is any arbitrary metadata attached to the proposal. - string metadata = 3; - - // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. - repeated google.protobuf.Any messages = 4; - - // exec defines the mode of execution of the proposal, - // whether it should be executed immediately on creation or not. - // If so, proposers signatures are considered as Yes votes. - Exec exec = 5; - - // title is the title of the proposal. - // - // Since: cosmos-sdk 0.47 - string title = 6; - - // summary is the summary of the proposal. - // - // Since: cosmos-sdk 0.47 - string summary = 7; -} - -// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - // proposal is the unique ID of the proposal. - uint64 proposal_id = 1; -} - -// MsgWithdrawProposal is the Msg/WithdrawProposal request type. -message MsgWithdrawProposal { - option (cosmos.msg.v1.signer) = "address"; - option (amino.name) = "cosmos-sdk/group/MsgWithdrawProposal"; - - // proposal is the unique ID of the proposal. - uint64 proposal_id = 1; - - // address is the admin of the group policy or one of the proposer of the proposal. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. -message MsgWithdrawProposalResponse {} - -// MsgVote is the Msg/Vote request type. -message MsgVote { - option (cosmos.msg.v1.signer) = "voter"; - option (amino.name) = "cosmos-sdk/group/MsgVote"; - - // proposal is the unique ID of the proposal. - uint64 proposal_id = 1; - - // voter is the voter account address. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // option is the voter's choice on the proposal. - VoteOption option = 3; - - // metadata is any arbitrary metadata attached to the vote. - string metadata = 4; - - // exec defines whether the proposal should be executed - // immediately after voting or not. - Exec exec = 5; -} - -// MsgVoteResponse is the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgExec is the Msg/Exec request type. -message MsgExec { - option (cosmos.msg.v1.signer) = "signer"; - option (amino.name) = "cosmos-sdk/group/MsgExec"; - - // proposal is the unique ID of the proposal. - uint64 proposal_id = 1; - - // executor is the account address used to execute the proposal. - string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgExecResponse is the Msg/Exec request type. -message MsgExecResponse { - // result is the final result of the proposal execution. - ProposalExecutorResult result = 2; -} - -// MsgLeaveGroup is the Msg/LeaveGroup request type. -message MsgLeaveGroup { - option (cosmos.msg.v1.signer) = "address"; - option (amino.name) = "cosmos-sdk/group/MsgLeaveGroup"; - - // address is the account address of the group member. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; -} - -// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. -message MsgLeaveGroupResponse {} diff --git a/proto/cosmos/group/v1/types.proto b/proto/cosmos/group/v1/types.proto deleted file mode 100644 index 4968d13c..00000000 --- a/proto/cosmos/group/v1/types.proto +++ /dev/null @@ -1,337 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; - -package cosmos.group.v1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/group"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/any.proto"; -import "amino/amino.proto"; - -// Member represents a group member with an account address, -// non-zero weight, metadata and added_at timestamp. -message Member { - // address is the member's account address. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // weight is the member's voting weight that should be greater than 0. - string weight = 2; - - // metadata is any arbitrary metadata attached to the member. - string metadata = 3; - - // added_at is a timestamp specifying when a member was added. - google.protobuf.Timestamp added_at = 4 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// MemberRequest represents a group member to be used in Msg server requests. -// Contrary to `Member`, it doesn't have any `added_at` field -// since this field cannot be set as part of requests. -message MemberRequest { - // address is the member's account address. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // weight is the member's voting weight that should be greater than 0. - string weight = 2; - - // metadata is any arbitrary metadata attached to the member. - string metadata = 3; -} - -// ThresholdDecisionPolicy is a decision policy where a proposal passes when it -// satisfies the two following conditions: -// 1. The sum of all `YES` voter's weights is greater or equal than the defined -// `threshold`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. -message ThresholdDecisionPolicy { - option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; - option (amino.name) = "cosmos-sdk/ThresholdDecisionPolicy"; - - // threshold is the minimum weighted sum of `YES` votes that must be met or - // exceeded for a proposal to succeed. - string threshold = 1; - - // windows defines the different windows for voting and execution. - DecisionPolicyWindows windows = 2; -} - -// PercentageDecisionPolicy is a decision policy where a proposal passes when -// it satisfies the two following conditions: -// 1. The percentage of all `YES` voters' weights out of the total group weight -// is greater or equal than the given `percentage`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. -message PercentageDecisionPolicy { - option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; - option (amino.name) = "cosmos-sdk/PercentageDecisionPolicy"; - - // percentage is the minimum percentage of the weighted sum of `YES` votes must - // meet for a proposal to succeed. - string percentage = 1; - - // windows defines the different windows for voting and execution. - DecisionPolicyWindows windows = 2; -} - -// DecisionPolicyWindows defines the different windows for voting and execution. -message DecisionPolicyWindows { - // voting_period is the duration from submission of a proposal to the end of voting period - // Within this times votes can be submitted with MsgVote. - google.protobuf.Duration voting_period = 1 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // min_execution_period is the minimum duration after the proposal submission - // where members can start sending MsgExec. This means that the window for - // sending a MsgExec transaction is: - // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` - // where max_execution_period is a app-specific config, defined in the keeper. - // If not set, min_execution_period will default to 0. - // - // Please make sure to set a `min_execution_period` that is smaller than - // `voting_period + max_execution_period`, or else the above execution window - // is empty, meaning that all proposals created with this decision policy - // won't be able to be executed. - google.protobuf.Duration min_execution_period = 2 - [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// VoteOption enumerates the valid vote options for a given proposal. -enum VoteOption { - option (gogoproto.goproto_enum_prefix) = false; - - // VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will - // return an error. - VOTE_OPTION_UNSPECIFIED = 0; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4; -} - -// -// State -// - -// GroupInfo represents the high-level on-chain information for a group. -message GroupInfo { - // id is the unique ID of the group. - uint64 id = 1; - - // admin is the account address of the group's admin. - string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // metadata is any arbitrary metadata to attached to the group. - string metadata = 3; - - // version is used to track changes to a group's membership structure that - // would break existing proposals. Whenever any members weight is changed, - // or any member is added or removed this version is incremented and will - // cause proposals based on older versions of this group to fail - uint64 version = 4; - - // total_weight is the sum of the group members' weights. - string total_weight = 5; - - // created_at is a timestamp specifying when a group was created. - google.protobuf.Timestamp created_at = 6 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// GroupMember represents the relationship between a group and a member. -message GroupMember { - // group_id is the unique ID of the group. - uint64 group_id = 1; - - // member is the member data. - Member member = 2; -} - -// GroupPolicyInfo represents the high-level on-chain information for a group policy. -message GroupPolicyInfo { - option (gogoproto.equal) = true; - option (gogoproto.goproto_getters) = false; - - // address is the account address of group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // group_id is the unique ID of the group. - uint64 group_id = 2; - - // admin is the account address of the group admin. - string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // metadata is any arbitrary metadata attached to the group policy. - // the recommended format of the metadata is to be found here: - // https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 - string metadata = 4; - - // version is used to track changes to a group's GroupPolicyInfo structure that - // would create a different result on a running proposal. - uint64 version = 5; - - // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; - - // created_at is a timestamp specifying when a group policy was created. - google.protobuf.Timestamp created_at = 7 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// Proposal defines a group proposal. Any member of a group can submit a proposal -// for a group policy to decide upon. -// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal -// passes as well as some optional metadata associated with the proposal. -message Proposal { - option (gogoproto.goproto_getters) = false; - - // id is the unique id of the proposal. - uint64 id = 1; - - // group_policy_address is the account address of group policy. - string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: - // https://docs.cosmos.network/v0.47/modules/group#proposal-4 - string metadata = 3; - - // proposers are the account addresses of the proposers. - repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // submit_time is a timestamp specifying when a proposal was submitted. - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - - // group_version tracks the version of the group at proposal submission. - // This field is here for informational purposes only. - uint64 group_version = 6; - - // group_policy_version tracks the version of the group policy at proposal submission. - // When a decision policy is changed, existing proposals from previous policy - // versions will become invalid with the `ABORTED` status. - // This field is here for informational purposes only. - uint64 group_policy_version = 7; - - // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. - ProposalStatus status = 8; - - // final_tally_result contains the sums of all weighted votes for this - // proposal for each vote option. It is empty at submission, and only - // populated after tallying, at voting period end or at proposal execution, - // whichever happens first. - TallyResult final_tally_result = 9 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // voting_period_end is the timestamp before which voting must be done. - // Unless a successful MsgExec is called before (to execute a proposal whose - // tally is successful before the voting period ends), tallying will be done - // at this point, and the `final_tally_result`and `status` fields will be - // accordingly updated. - google.protobuf.Timestamp voting_period_end = 10 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - - // executor_result is the final result of the proposal execution. Initial value is NotRun. - ProposalExecutorResult executor_result = 11; - - // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. - repeated google.protobuf.Any messages = 12; - - // title is the title of the proposal - // - // Since: cosmos-sdk 0.47 - string title = 13; - - // summary is a short summary of the proposal - // - // Since: cosmos-sdk 0.47 - string summary = 14; -} - -// ProposalStatus defines proposal statuses. -enum ProposalStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // An empty value is invalid and not allowed. - PROPOSAL_STATUS_UNSPECIFIED = 0; - - // Initial status of a proposal when submitted. - PROPOSAL_STATUS_SUBMITTED = 1; - - // Final status of a proposal when the final tally is done and the outcome - // passes the group policy's decision policy. - PROPOSAL_STATUS_ACCEPTED = 2; - - // Final status of a proposal when the final tally is done and the outcome - // is rejected by the group policy's decision policy. - PROPOSAL_STATUS_REJECTED = 3; - - // Final status of a proposal when the group policy is modified before the - // final tally. - PROPOSAL_STATUS_ABORTED = 4; - - // A proposal can be withdrawn before the voting start time by the owner. - // When this happens the final status is Withdrawn. - PROPOSAL_STATUS_WITHDRAWN = 5; -} - -// ProposalExecutorResult defines types of proposal executor results. -enum ProposalExecutorResult { - option (gogoproto.goproto_enum_prefix) = false; - - // An empty value is not allowed. - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0; - - // We have not yet run the executor. - PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1; - - // The executor was successful and proposed action updated state. - PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2; - - // The executor returned an error and proposed action didn't update state. - PROPOSAL_EXECUTOR_RESULT_FAILURE = 3; -} - -// TallyResult represents the sum of weighted votes for each vote option. -message TallyResult { - option (gogoproto.goproto_getters) = false; - - // yes_count is the weighted sum of yes votes. - string yes_count = 1; - - // abstain_count is the weighted sum of abstainers. - string abstain_count = 2; - - // no_count is the weighted sum of no votes. - string no_count = 3; - - // no_with_veto_count is the weighted sum of veto. - string no_with_veto_count = 4; -} - -// Vote represents a vote for a proposal. -message Vote { - // proposal is the unique ID of the proposal. - uint64 proposal_id = 1; - - // voter is the account address of the voter. - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // option is the voter's choice on the proposal. - VoteOption option = 3; - - // metadata is any arbitrary metadata attached to the vote. - string metadata = 4; - - // submit_time is the timestamp when the vote was submitted. - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} diff --git a/proto/cosmos/mint/module/v1/module.proto b/proto/cosmos/mint/module/v1/module.proto deleted file mode 100644 index 2ea1ef3d..00000000 --- a/proto/cosmos/mint/module/v1/module.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package cosmos.mint.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the mint module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/mint" - }; - - string fee_collector_name = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} \ No newline at end of file diff --git a/proto/cosmos/mint/v1beta1/genesis.proto b/proto/cosmos/mint/v1beta1/genesis.proto deleted file mode 100644 index b6cc1504..00000000 --- a/proto/cosmos/mint/v1beta1/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/mint/v1beta1/mint.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// GenesisState defines the mint module's genesis state. -message GenesisState { - // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // params defines all the parameters of the module. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto deleted file mode 100644 index 49b00a5d..00000000 --- a/proto/cosmos/mint/v1beta1/mint.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// Minter represents the minting state. -message Minter { - // current annual inflation rate - string inflation = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // current annual expected provisions - string annual_provisions = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Params defines the parameters for the x/mint module. -message Params { - option (gogoproto.goproto_stringer) = false; - option (amino.name) = "cosmos-sdk/x/mint/Params"; - - // type of coin to mint - string mint_denom = 1; - // maximum annual change in inflation rate - string inflation_rate_change = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // maximum inflation rate - string inflation_max = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // minimum inflation rate - string inflation_min = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // goal of percent bonded atoms - string goal_bonded = 5 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // expected blocks per year - uint64 blocks_per_year = 6; -} diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto deleted file mode 100644 index 002f2744..00000000 --- a/proto/cosmos/mint/v1beta1/query.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/mint/v1beta1/mint.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params returns the total set of minting parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; - } - - // Inflation returns the current minting inflation value. - rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; - } - - // AnnualProvisions current minting annual provisions value. - rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryInflationRequest is the request type for the Query/Inflation RPC method. -message QueryInflationRequest {} - -// QueryInflationResponse is the response type for the Query/Inflation RPC -// method. -message QueryInflationResponse { - // inflation is the current minting inflation value. - bytes inflation = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// QueryAnnualProvisionsRequest is the request type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsRequest {} - -// QueryAnnualProvisionsResponse is the response type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsResponse { - // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} diff --git a/proto/cosmos/mint/v1beta1/tx.proto b/proto/cosmos/mint/v1beta1/tx.proto deleted file mode 100644 index ec71fb73..00000000 --- a/proto/cosmos/mint/v1beta1/tx.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; -import "cosmos/mint/v1beta1/mint.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -// Msg defines the x/mint Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // UpdateParams defines a governance operation for updating the x/mint module - // parameters. The authority is defaults to the x/gov module account. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/mint/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/mint parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/msg/v1/msg.proto b/proto/cosmos/msg/v1/msg.proto deleted file mode 100644 index 853efa1f..00000000 --- a/proto/cosmos/msg/v1/msg.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package cosmos.msg.v1; - -import "google/protobuf/descriptor.proto"; - -// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. -// We need this right now because gogoproto codegen needs to import the extension. -option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; - -extend google.protobuf.ServiceOptions { - // service indicates that the service is a Msg service and that requests - // must be transported via blockchain transactions rather than gRPC. - // Tooling can use this annotation to distinguish between Msg services and - // other types of services via reflection. - bool service = 11110000; -} - -extend google.protobuf.MessageOptions { - // signer must be used in cosmos messages in order - // to signal to external clients which fields in a - // given cosmos message must be filled with signer - // information (address). - // The field must be the protobuf name of the message - // field extended with this MessageOption. - // The field must either be of string kind, or of message - // kind in case the signer information is contained within - // a message inside the cosmos message. - repeated string signer = 11110000; -} diff --git a/proto/cosmos/nft/module/v1/module.proto b/proto/cosmos/nft/module/v1/module.proto deleted file mode 100644 index 8f820fa0..00000000 --- a/proto/cosmos/nft/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.nft.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the nft module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/nft" - }; -} \ No newline at end of file diff --git a/proto/cosmos/nft/v1beta1/event.proto b/proto/cosmos/nft/v1beta1/event.proto deleted file mode 100644 index 2f6d5a0d..00000000 --- a/proto/cosmos/nft/v1beta1/event.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package cosmos.nft.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; - -// EventSend is emitted on Msg/Send -message EventSend { - // class_id associated with the nft - string class_id = 1; - - // id is a unique identifier of the nft - string id = 2; - - // sender is the address of the owner of nft - string sender = 3; - - // receiver is the receiver address of nft - string receiver = 4; -} - -// EventMint is emitted on Mint -message EventMint { - // class_id associated with the nft - string class_id = 1; - - // id is a unique identifier of the nft - string id = 2; - - // owner is the owner address of the nft - string owner = 3; -} - -// EventBurn is emitted on Burn -message EventBurn { - // class_id associated with the nft - string class_id = 1; - - // id is a unique identifier of the nft - string id = 2; - - // owner is the owner address of the nft - string owner = 3; -} diff --git a/proto/cosmos/nft/v1beta1/genesis.proto b/proto/cosmos/nft/v1beta1/genesis.proto deleted file mode 100644 index 75b5245a..00000000 --- a/proto/cosmos/nft/v1beta1/genesis.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package cosmos.nft.v1beta1; - -import "cosmos/nft/v1beta1/nft.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; - -// GenesisState defines the nft module's genesis state. -message GenesisState { - // class defines the class of the nft type. - repeated cosmos.nft.v1beta1.Class classes = 1; - - // entry defines all nft owned by a person. - repeated Entry entries = 2; -} - -// Entry Defines all nft owned by a person -message Entry { - // owner is the owner address of the following nft - string owner = 1; - - // nfts is a group of nfts of the same owner - repeated cosmos.nft.v1beta1.NFT nfts = 2; -} diff --git a/proto/cosmos/nft/v1beta1/nft.proto b/proto/cosmos/nft/v1beta1/nft.proto deleted file mode 100644 index b1241260..00000000 --- a/proto/cosmos/nft/v1beta1/nft.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; -package cosmos.nft.v1beta1; - -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; - -// Class defines the class of the nft type. -message Class { - // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 - string id = 1; - - // name defines the human-readable name of the NFT classification. Optional - string name = 2; - - // symbol is an abbreviated name for nft classification. Optional - string symbol = 3; - - // description is a brief description of nft classification. Optional - string description = 4; - - // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional - string uri = 5; - - // uri_hash is a hash of the document pointed by uri. Optional - string uri_hash = 6; - - // data is the app specific metadata of the NFT class. Optional - google.protobuf.Any data = 7; -} - -// NFT defines the NFT. -message NFT { - // class_id associated with the NFT, similar to the contract address of ERC721 - string class_id = 1; - - // id is a unique identifier of the NFT - string id = 2; - - // uri for the NFT metadata stored off chain - string uri = 3; - - // uri_hash is a hash of the document pointed by uri - string uri_hash = 4; - - // data is an app specific data of the NFT. Optional - google.protobuf.Any data = 10; -} diff --git a/proto/cosmos/nft/v1beta1/query.proto b/proto/cosmos/nft/v1beta1/query.proto deleted file mode 100644 index ae482e4c..00000000 --- a/proto/cosmos/nft/v1beta1/query.proto +++ /dev/null @@ -1,152 +0,0 @@ -syntax = "proto3"; -package cosmos.nft.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; -import "cosmos/nft/v1beta1/nft.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; - -// Query defines the gRPC querier service. -service Query { - // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 - rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}"; - } - - // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 - rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}"; - } - - // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. - rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}"; - } - - // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in - // ERC721Enumerable - rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/nfts"; - } - - // NFT queries an NFT based on its class and id. - rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}"; - } - - // Class queries an NFT class based on its id - rpc Class(QueryClassRequest) returns (QueryClassResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}"; - } - - // Classes queries all NFT classes - rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { - option (google.api.http).get = "/cosmos/nft/v1beta1/classes"; - } -} - -// QueryBalanceRequest is the request type for the Query/Balance RPC method -message QueryBalanceRequest { - // class_id associated with the nft - string class_id = 1; - - // owner is the owner address of the nft - string owner = 2; -} - -// QueryBalanceResponse is the response type for the Query/Balance RPC method -message QueryBalanceResponse { - // amount is the number of all NFTs of a given class owned by the owner - uint64 amount = 1; -} - -// QueryOwnerRequest is the request type for the Query/Owner RPC method -message QueryOwnerRequest { - // class_id associated with the nft - string class_id = 1; - - // id is a unique identifier of the NFT - string id = 2; -} - -// QueryOwnerResponse is the response type for the Query/Owner RPC method -message QueryOwnerResponse { - // owner is the owner address of the nft - string owner = 1; -} - -// QuerySupplyRequest is the request type for the Query/Supply RPC method -message QuerySupplyRequest { - // class_id associated with the nft - string class_id = 1; -} - -// QuerySupplyResponse is the response type for the Query/Supply RPC method -message QuerySupplyResponse { - // amount is the number of all NFTs from the given class - uint64 amount = 1; -} - -// QueryNFTstRequest is the request type for the Query/NFTs RPC method -message QueryNFTsRequest { - // class_id associated with the nft - string class_id = 1; - - // owner is the owner address of the nft - string owner = 2; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryNFTsResponse is the response type for the Query/NFTs RPC methods -message QueryNFTsResponse { - // NFT defines the NFT - repeated cosmos.nft.v1beta1.NFT nfts = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryNFTRequest is the request type for the Query/NFT RPC method -message QueryNFTRequest { - // class_id associated with the nft - string class_id = 1; - - // id is a unique identifier of the NFT - string id = 2; -} - -// QueryNFTResponse is the response type for the Query/NFT RPC method -message QueryNFTResponse { - // owner is the owner address of the nft - cosmos.nft.v1beta1.NFT nft = 1; -} - -// QueryClassRequest is the request type for the Query/Class RPC method -message QueryClassRequest { - // class_id associated with the nft - string class_id = 1; -} - -// QueryClassResponse is the response type for the Query/Class RPC method -message QueryClassResponse { - // class defines the class of the nft type. - cosmos.nft.v1beta1.Class class = 1; -} - -// QueryClassesRequest is the request type for the Query/Classes RPC method -message QueryClassesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryClassesResponse is the response type for the Query/Classes RPC method -message QueryClassesResponse { - // class defines the class of the nft type. - repeated cosmos.nft.v1beta1.Class classes = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/nft/v1beta1/tx.proto b/proto/cosmos/nft/v1beta1/tx.proto deleted file mode 100644 index 0637cd8d..00000000 --- a/proto/cosmos/nft/v1beta1/tx.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package cosmos.nft.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/nft"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; - -// Msg defines the nft Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // Send defines a method to send a nft from one account to another account. - rpc Send(MsgSend) returns (MsgSendResponse); -} - -// MsgSend represents a message to send a nft from one account to another account. -message MsgSend { - option (cosmos.msg.v1.signer) = "sender"; - - // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 - string class_id = 1; - - // id defines the unique identification of nft - string id = 2; - - // sender is the address of the owner of nft - string sender = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // receiver is the receiver address of nft - string receiver = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} -// MsgSendResponse defines the Msg/Send response type. -message MsgSendResponse {} \ No newline at end of file diff --git a/proto/cosmos/orm/module/v1alpha1/module.proto b/proto/cosmos/orm/module/v1alpha1/module.proto deleted file mode 100644 index cb7bbbee..00000000 --- a/proto/cosmos/orm/module/v1alpha1/module.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.module.v1alpha1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module defines the ORM module which adds providers to the app container for -// module-scoped DB's. In the future it may provide gRPC services for interacting -// with ORM data. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/orm" - }; -} diff --git a/proto/cosmos/orm/query/v1alpha1/query.proto b/proto/cosmos/orm/query/v1alpha1/query.proto deleted file mode 100644 index 4500e99d..00000000 --- a/proto/cosmos/orm/query/v1alpha1/query.proto +++ /dev/null @@ -1,131 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.query.v1alpha1; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -// Query is a generic gRPC service for querying ORM data. -service Query { - - // Get queries an ORM table against an unique index. - rpc Get(GetRequest) returns (GetResponse); - - // List queries an ORM table against an index. - rpc List(ListRequest) returns (ListResponse); -} - -// GetRequest is the Query/Get request type. -message GetRequest { - // message_name is the fully-qualified message name of the ORM table being queried. - string message_name = 1; - - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. If it is non-empty, it must - // refer to an unique index. - string index = 2; - - // values are the values of the fields corresponding to the requested index. - // There must be as many values provided as there are fields in the index and - // these values must correspond to the index field types. - repeated IndexValue values = 3; -} - -// GetResponse is the Query/Get response type. -message GetResponse { - - // result is the result of the get query. If no value is found, the gRPC - // status code NOT_FOUND will be returned. - google.protobuf.Any result = 1; -} - -// ListRequest is the Query/List request type. -message ListRequest { - // message_name is the fully-qualified message name of the ORM table being queried. - string message_name = 1; - - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. - string index = 2; - - // query is the query expression corresponding to the provided index. If - // neither prefix nor range is specified, the query will list all the fields - // in the index. - oneof query { - - // prefix defines a prefix query. - Prefix prefix = 3; - - // range defines a range query. - Range range = 4; - } - - // pagination is the pagination request. - cosmos.base.query.v1beta1.PageRequest pagination = 5; - - // Prefix specifies the arguments to a prefix query. - message Prefix { - // values specifies the index values for the prefix query. - // It is valid to special a partial prefix with fewer values than - // the number of fields in the index. - repeated IndexValue values = 1; - } - - // Range specifies the arguments to a range query. - message Range { - // start specifies the starting index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - repeated IndexValue start = 1; - - // end specifies the inclusive ending index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - repeated IndexValue end = 2; - } -} - -// ListResponse is the Query/List response type. -message ListResponse { - - // results are the results of the query. - repeated google.protobuf.Any results = 1; - - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 5; -} - -// IndexValue represents the value of a field in an ORM index expression. -message IndexValue { - - // value specifies the index value - oneof value { - // uint specifies a value for an uint32, fixed32, uint64, or fixed64 - // index field. - uint64 uint = 1; - - // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 - // index field. - int64 int = 2; - - // str specifies a value for a string index field. - string str = 3; - - // bytes specifies a value for a bytes index field. - bytes bytes = 4; - - // enum specifies a value for an enum index field. - string enum = 5; - - // bool specifies a value for a bool index field. - bool bool = 6; - - // timestamp specifies a value for a timestamp index field. - google.protobuf.Timestamp timestamp = 7; - - // duration specifies a value for a duration index field. - google.protobuf.Duration duration = 8; - } -} diff --git a/proto/cosmos/orm/v1/orm.proto b/proto/cosmos/orm/v1/orm.proto deleted file mode 100644 index 389babd1..00000000 --- a/proto/cosmos/orm/v1/orm.proto +++ /dev/null @@ -1,104 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - - // table specifies that this message will be used as an ORM table. It cannot - // be used together with the singleton option. - TableDescriptor table = 104503790; - - // singleton specifies that this message will be used as an ORM singleton. It cannot - // be used together with the table option. - SingletonDescriptor singleton = 104503791; -} - -// TableDescriptor describes an ORM table. -message TableDescriptor { - - // primary_key defines the primary key for the table. - PrimaryKeyDescriptor primary_key = 1; - - // index defines one or more secondary indexes. - repeated SecondaryIndexDescriptor index = 2; - - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - uint32 id = 3; -} - -// PrimaryKeyDescriptor describes a table primary key. -message PrimaryKeyDescriptor { - - // fields is a comma-separated list of fields in the primary key. Spaces are - // not allowed. Supported field types, their encodings, and any applicable constraints - // are described below. - // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers. - // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers such as auto-incrementing sequences. - // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support - // sorted iteration. These types are well-suited for encoding fixed with - // decimals as integers. - // - string's are encoded as raw bytes in terminal key segments and null-terminated - // in non-terminal segments. Null characters are thus forbidden in strings. - // string fields support sorted iteration. - // - bytes are encoded as raw bytes in terminal segments and length-prefixed - // with a 32-bit unsigned varint in non-terminal segments. - // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with - // an encoding that enables sorted iteration. - // - google.protobuf.Timestamp and google.protobuf.Duration are encoded - // as 12 bytes using an encoding that enables sorted iteration. - // - enum fields are encoded using varint encoding and do not support sorted - // iteration. - // - bool fields are encoded as a single byte 0 or 1. - // - // All other fields types are unsupported in keys including repeated and - // oneof fields. - // - // Primary keys are prefixed by the varint encoded table id and the byte 0x0 - // plus any additional prefix specified by the schema. - string fields = 1; - - // auto_increment specifies that the primary key is generated by an - // auto-incrementing integer. If this is set to true fields must only - // contain one field of that is of type uint64. - bool auto_increment = 2; -} - -// PrimaryKeyDescriptor describes a table secondary index. -message SecondaryIndexDescriptor { - - // fields is a comma-separated list of fields in the index. The supported - // field types are the same as those for PrimaryKeyDescriptor.fields. - // Index keys are prefixed by the varint encoded table id and the varint - // encoded index id plus any additional prefix specified by the schema. - // - // In addition the field segments, non-unique index keys are suffixed with - // any additional primary key fields not present in the index fields so that the - // primary key can be reconstructed. Unique indexes instead of being suffixed - // store the remaining primary key fields in the value.. - string fields = 1; - - // id is a non-zero integer ID that must be unique within the indexes for this - // table and less than 32768. It may be deprecated in the future when this can - // be auto-generated. - uint32 id = 2; - - // unique specifies that this an unique index. - bool unique = 3; -} - -// TableDescriptor describes an ORM singleton table which has at most one instance. -message SingletonDescriptor { - - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - uint32 id = 1; -} \ No newline at end of file diff --git a/proto/cosmos/orm/v1alpha1/schema.proto b/proto/cosmos/orm/v1alpha1/schema.proto deleted file mode 100644 index ab713340..00000000 --- a/proto/cosmos/orm/v1alpha1/schema.proto +++ /dev/null @@ -1,76 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1alpha1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - // module_schema is used to define the ORM schema for an app module. - // All module config messages that use module_schema must also declare - // themselves as app module config messages using the cosmos.app.v1.is_module - // option. - ModuleSchemaDescriptor module_schema = 104503792; -} - -// ModuleSchemaDescriptor describe's a module's ORM schema. -message ModuleSchemaDescriptor { - repeated FileEntry schema_file = 1; - - // FileEntry describes an ORM file used in a module. - message FileEntry { - // id is a prefix that will be varint encoded and prepended to all the - // table keys specified in the file's tables. - uint32 id = 1; - - // proto_file_name is the name of a file .proto in that contains - // table definitions. The .proto file must be in a package that the - // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. - string proto_file_name = 2; - - // storage_type optionally indicates the type of storage this file's - // tables should used. If it is left unspecified, the default KV-storage - // of the app will be used. - StorageType storage_type = 3; - } - - // prefix is an optional prefix that precedes all keys in this module's - // store. - bytes prefix = 2; -} - -// StorageType -enum StorageType { - // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent - // KV-storage where primary key entries are stored in merkle-tree - // backed commitment storage and indexes and seqs are stored in - // fast index storage. Note that the Cosmos SDK before store/v2alpha1 - // does not support this. - STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; - - // STORAGE_TYPE_MEMORY indicates in-memory storage that will be - // reloaded every time an app restarts. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_MEMORY = 1; - - // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset - // at the end of every block. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_TRANSIENT = 2; - - // STORAGE_TYPE_INDEX indicates persistent storage which is not backed - // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK - // before store/v2alpha1 does not support this. - STORAGE_TYPE_INDEX = 3; - - // STORAGE_TYPE_INDEX indicates persistent storage which is backed by - // a merkle-tree. With this type of storage, both primary and index keys - // will affect the app hash and this is generally less efficient - // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index - // keys into index storage. Note that modules built with the - // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT - // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX - // because this is the only type of persistent storage available. - STORAGE_TYPE_COMMITMENT = 4; -} diff --git a/proto/cosmos/params/module/v1/module.proto b/proto/cosmos/params/module/v1/module.proto deleted file mode 100644 index 75e7f995..00000000 --- a/proto/cosmos/params/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.params.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the params module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/params" - }; -} diff --git a/proto/cosmos/params/v1beta1/params.proto b/proto/cosmos/params/v1beta1/params.proto deleted file mode 100644 index 7bda4651..00000000 --- a/proto/cosmos/params/v1beta1/params.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// ParameterChangeProposal defines a proposal to change one or more parameters. -message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; - - string title = 1; - string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ParamChange defines an individual parameter change, for use in -// ParameterChangeProposal. -message ParamChange { - option (gogoproto.goproto_stringer) = false; - - string subspace = 1; - string key = 2; - string value = 3; -} diff --git a/proto/cosmos/params/v1beta1/query.proto b/proto/cosmos/params/v1beta1/query.proto deleted file mode 100644 index 827422ea..00000000 --- a/proto/cosmos/params/v1beta1/query.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/params/v1beta1/params.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; - -// Query defines the gRPC querier service. -service Query { - // Params queries a specific parameter of a module, given its subspace and - // key. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/params/v1beta1/params"; - } - - // Subspaces queries for all registered subspaces and all keys for a subspace. - // - // Since: cosmos-sdk 0.46 - rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { - option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest { - // subspace defines the module to query the parameter for. - string subspace = 1; - - // key defines the key of the parameter in the subspace. - string key = 2; -} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QuerySubspacesRequest defines a request type for querying for all registered -// subspaces and all keys for a subspace. -// -// Since: cosmos-sdk 0.46 -message QuerySubspacesRequest {} - -// QuerySubspacesResponse defines the response types for querying for all -// registered subspaces and all keys for a subspace. -// -// Since: cosmos-sdk 0.46 -message QuerySubspacesResponse { - repeated Subspace subspaces = 1; -} - -// Subspace defines a parameter subspace name and all the keys that exist for -// the subspace. -// -// Since: cosmos-sdk 0.46 -message Subspace { - string subspace = 1; - repeated string keys = 2; -} diff --git a/proto/cosmos/query/v1/query.proto b/proto/cosmos/query/v1/query.proto deleted file mode 100644 index e42e73d7..00000000 --- a/proto/cosmos/query/v1/query.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package cosmos.query.v1; - -import "google/protobuf/descriptor.proto"; - -// TODO: once we fully migrate to protov2 the go_package needs to be updated. -// We need this right now because gogoproto codegen needs to import the extension. -option go_package = "github.com/cosmos/cosmos-sdk/types/query"; - -extend google.protobuf.MethodOptions { - // module_query_safe is set to true when the query is safe to be called from - // within the state machine, for example from another module's Keeper, via - // ADR-033 calls or from CosmWasm contracts. - // Concretely, it means that the query is: - // 1. deterministic: given a block height, returns the exact same response - // upon multiple calls; and doesn't introduce any state-machine-breaking - // changes across SDK patch version. - // 2. consumes gas correctly. - // - // If you are a module developer and want to add this annotation to one of - // your own queries, please make sure that the corresponding query: - // 1. is deterministic and won't introduce state-machine-breaking changes - // without a coordinated upgrade path, - // 2. has its gas tracked, to avoid the attack vector where no gas is - // accounted for on potentially high-computation queries. - // - // For queries that potentially consume a large amount of gas (for example - // those with pagination, if the pagination field is incorrectly set), we - // also recommend adding Protobuf comments to warn module developers - // consuming these queries. - // - // When set to true, the query can safely be called - bool module_query_safe = 11110001; -} \ No newline at end of file diff --git a/proto/cosmos/reflection/v1/reflection.proto b/proto/cosmos/reflection/v1/reflection.proto deleted file mode 100644 index 1f575b83..00000000 --- a/proto/cosmos/reflection/v1/reflection.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; - -package cosmos.reflection.v1; - -import "google/protobuf/descriptor.proto"; -import "cosmos/query/v1/query.proto"; - -// Package cosmos.reflection.v1 provides support for inspecting protobuf -// file descriptors. -service ReflectionService { - // FileDescriptors queries all the file descriptors in the app in order - // to enable easier generation of dynamic clients. - rpc FileDescriptors(FileDescriptorsRequest) returns (FileDescriptorsResponse) { - // NOTE: file descriptors SHOULD NOT be part of consensus because they - // include changes to doc commands and module_query_safe should be kept as false. - option (cosmos.query.v1.module_query_safe) = false; - } -} - -// FileDescriptorsRequest is the Query/FileDescriptors request type. -message FileDescriptorsRequest {} - -// FileDescriptorsResponse is the Query/FileDescriptors response type. -message FileDescriptorsResponse { - // files is the file descriptors. - repeated google.protobuf.FileDescriptorProto files = 1; -} diff --git a/proto/cosmos/slashing/module/v1/module.proto b/proto/cosmos/slashing/module/v1/module.proto deleted file mode 100644 index 52433075..00000000 --- a/proto/cosmos/slashing/module/v1/module.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package cosmos.slashing.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the slashing module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/slashing" - }; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 1; -} diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto deleted file mode 100644 index 36bcf76f..00000000 --- a/proto/cosmos/slashing/v1beta1/genesis.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// GenesisState defines the slashing module's genesis state. -message GenesisState { - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // signing_infos represents a map between validator addresses and their - // signing infos. - repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // missed_blocks represents a map between validator addresses and their - // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// SigningInfo stores validator signing info of corresponding address. -message SigningInfo { - // address is the validator address. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ValidatorMissedBlocks contains array of missed blocks of corresponding -// address. -message ValidatorMissedBlocks { - // address is the validator address. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MissedBlock contains height and missed status as boolean. -message MissedBlock { - // index is the height at which the block was missed. - int64 index = 1; - // missed is the missed status. - bool missed = 2; -} diff --git a/proto/cosmos/slashing/v1beta1/query.proto b/proto/cosmos/slashing/v1beta1/query.proto deleted file mode 100644 index 761e1a4b..00000000 --- a/proto/cosmos/slashing/v1beta1/query.proto +++ /dev/null @@ -1,66 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -// Query provides defines the gRPC querier service -service Query { - // Params queries the parameters of slashing module - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; - } - - // SigningInfo queries the signing info of given cons address - rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; - } - - // SigningInfos queries signing info of all validators - rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC -// method -message QuerySigningInfoRequest { - // cons_address is the address to query signing info of - string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC -// method -message QuerySigningInfoResponse { - // val_signing_info is the signing info of requested val cons address - ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC -// method -message QuerySigningInfosRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC -// method -message QuerySigningInfosResponse { - // info is the signing info of all validators - repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto deleted file mode 100644 index dc1f4211..00000000 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// ValidatorSigningInfo defines a validator's signing info for monitoring their -// liveness activity. -message ValidatorSigningInfo { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Height at which validator was first a candidate OR was unjailed - int64 start_height = 2; - // Index which is incremented each time the validator was a bonded - // in a block and may have signed a precommit or not. This in conjunction with the - // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - int64 index_offset = 3; - // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // Whether or not a validator has been tombstoned (killed out of validator set). It is set - // once the validator commits an equivocation or for any other configured misbehiavor. - bool tombstoned = 5; - // A counter kept to avoid unnecessary array reads. - // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - int64 missed_blocks_counter = 6; -} - -// Params represents the parameters used for by the slashing module. -message Params { - option (amino.name) = "cosmos-sdk/x/slashing/Params"; - - int64 signed_blocks_window = 1; - bytes min_signed_per_window = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - google.protobuf.Duration downtime_jail_duration = 3 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; - bytes slash_fraction_double_sign = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - bytes slash_fraction_downtime = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto deleted file mode 100644 index 300fc775..00000000 --- a/proto/cosmos/slashing/v1beta1/tx.proto +++ /dev/null @@ -1,68 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -// Msg defines the slashing Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // Unjail defines a method for unjailing a jailed validator, thus returning - // them into the bonded validator set, so they can begin receiving provisions - // and rewards again. - rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); - - // UpdateParams defines a governance operation for updating the x/slashing module - // parameters. The authority defaults to the x/gov module account. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUnjail defines the Msg/Unjail request type -message MsgUnjail { - option (cosmos.msg.v1.signer) = "validator_addr"; - option (amino.name) = "cosmos-sdk/MsgUnjail"; - - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_addr = 1 [ - (cosmos_proto.scalar) = "cosmos.AddressString", - (gogoproto.jsontag) = "address", - (amino.field_name) = "address", - (amino.dont_omitempty) = true - ]; -} - -// MsgUnjailResponse defines the Msg/Unjail response type -message MsgUnjailResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/slashing/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/slashing parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/staking/module/v1/module.proto b/proto/cosmos/staking/module/v1/module.proto deleted file mode 100644 index 7ef4a06c..00000000 --- a/proto/cosmos/staking/module/v1/module.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package cosmos.staking.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the staking module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/staking" - }; - - // hooks_order specifies the order of staking hooks and should be a list - // of module names which provide a staking hooks instance. If no order is - // provided, then hooks will be applied in alphabetical order of module names. - repeated string hooks_order = 1; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 2; -} diff --git a/proto/cosmos/staking/v1beta1/authz.proto b/proto/cosmos/staking/v1beta1/authz.proto deleted file mode 100644 index 055d1b64..00000000 --- a/proto/cosmos/staking/v1beta1/authz.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -// -// Since: cosmos-sdk 0.43 -message StakeAuthorization { - option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; - option (amino.name) = "cosmos-sdk/StakeAuthorization"; - - // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - // empty, there is no spend limit and any amount of coins can be delegated. - cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - // validators is the oneof that represents either allow_list or deny_list - oneof validators { - // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - // account. - Validators allow_list = 2; - // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - Validators deny_list = 3; - } - // Validators defines list of validator addresses. - message Validators { - repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - } - // authorization_type defines one of AuthorizationType. - AuthorizationType authorization_type = 4; -} - -// AuthorizationType defines the type of staking module authorization type -// -// Since: cosmos-sdk 0.43 -enum AuthorizationType { - // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - AUTHORIZATION_TYPE_UNSPECIFIED = 0; - // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - AUTHORIZATION_TYPE_DELEGATE = 1; - // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - AUTHORIZATION_TYPE_UNDELEGATE = 2; - // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - AUTHORIZATION_TYPE_REDELEGATE = 3; -} diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto deleted file mode 100644 index 482d50cc..00000000 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/staking/v1beta1/staking.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// GenesisState defines the staking module's genesis state. -message GenesisState { - // params defines all the parameters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // last_total_power tracks the total amounts of bonded tokens recorded during - // the previous end block. - bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - - // last_validator_powers is a special index that provides a historical list - // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // delegations defines the validator set at genesis. - repeated Validator validators = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // delegations defines the delegations active at genesis. - repeated Delegation delegations = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // redelegations defines the redelegations active at genesis. - repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - bool exported = 8; -} - -// LastValidatorPower required for validator set update logic. -message LastValidatorPower { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the validator. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // power defines the power of the validator. - int64 power = 2; -} diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto deleted file mode 100644 index 06eb5551..00000000 --- a/proto/cosmos/staking/v1beta1/query.proto +++ /dev/null @@ -1,387 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/staking/v1beta1/staking.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/query/v1/query.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// Query defines the gRPC querier service. -service Query { - // Validators queries all validators that match the given status. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; - } - - // Validator queries validator info for given validator address. - rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; - } - - // ValidatorDelegations queries delegate info for given validator. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; - } - - // ValidatorUnbondingDelegations queries unbonding delegations of a validator. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) - returns (QueryValidatorUnbondingDelegationsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" - "{validator_addr}/unbonding_delegations"; - } - - // Delegation queries delegate info for given validator delegator pair. - rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}"; - } - - // UnbondingDelegation queries unbonding info for given validator delegator - // pair. - rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}/unbonding_delegation"; - } - - // DelegatorDelegations queries all delegations of a given delegator address. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; - } - - // DelegatorUnbondingDelegations queries all unbonding delegations of a given - // delegator address. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) - returns (QueryDelegatorUnbondingDelegationsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" - "{delegator_addr}/unbonding_delegations"; - } - - // Redelegations queries redelegations of given address. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; - } - - // DelegatorValidators queries all validators info for given delegator - // address. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; - } - - // DelegatorValidator queries validator info for given delegator validator - // pair. - rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" - "{validator_addr}"; - } - - // HistoricalInfo queries the historical info for given height. - rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; - } - - // Pool queries the pool info. - rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; - } - - // Parameters queries the staking parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/staking/v1beta1/params"; - } -} - -// QueryValidatorsRequest is request type for Query/Validators RPC method. -message QueryValidatorsRequest { - // status enables to query for validators matching a given status. - string status = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorsResponse is response type for the Query/Validators RPC method -message QueryValidatorsResponse { - // validators contains all the queried validators. - repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryValidatorRequest is response type for the Query/Validator RPC method -message QueryValidatorRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryValidatorResponse is response type for the Query/Validator RPC method -message QueryValidatorResponse { - // validator defines the validator info. - Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryValidatorDelegationsRequest is request type for the -// Query/ValidatorDelegations RPC method -message QueryValidatorDelegationsRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorDelegationsResponse is response type for the -// Query/ValidatorDelegations RPC method -message QueryValidatorDelegationsResponse { - repeated DelegationResponse delegation_responses = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryValidatorUnbondingDelegationsRequest is required type for the -// Query/ValidatorUnbondingDelegations RPC method -message QueryValidatorUnbondingDelegationsRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorUnbondingDelegationsResponse is response type for the -// Query/ValidatorUnbondingDelegations RPC method. -message QueryValidatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegationRequest is request type for the Query/Delegation RPC method. -message QueryDelegationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegationResponse is response type for the Query/Delegation RPC method. -message QueryDelegationResponse { - // delegation_responses defines the delegation info of a delegation. - DelegationResponse delegation_response = 1; -} - -// QueryUnbondingDelegationRequest is request type for the -// Query/UnbondingDelegation RPC method. -message QueryUnbondingDelegationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegationResponse is response type for the Query/UnbondingDelegation -// RPC method. -message QueryUnbondingDelegationResponse { - // unbond defines the unbonding information of a delegation. - UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryDelegatorDelegationsRequest is request type for the -// Query/DelegatorDelegations RPC method. -message QueryDelegatorDelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDelegatorDelegationsResponse is response type for the -// Query/DelegatorDelegations RPC method. -message QueryDelegatorDelegationsResponse { - // delegation_responses defines all the delegations' info of a delegator. - repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorUnbondingDelegationsRequest is request type for the -// Query/DelegatorUnbondingDelegations RPC method. -message QueryDelegatorUnbondingDelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryUnbondingDelegatorDelegationsResponse is response type for the -// Query/UnbondingDelegatorDelegations RPC method. -message QueryDelegatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryRedelegationsRequest is request type for the Query/Redelegations RPC -// method. -message QueryRedelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // src_validator_addr defines the validator address to redelegate from. - string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // dst_validator_addr defines the validator address to redelegate to. - string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryRedelegationsResponse is response type for the Query/Redelegations RPC -// method. -message QueryRedelegationsResponse { - repeated RedelegationResponse redelegation_responses = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorValidatorsRequest is request type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDelegatorValidatorsResponse is response type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsResponse { - // validators defines the validators' info of a delegator. - repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorValidatorRequest is request type for the -// Query/DelegatorValidator RPC method. -message QueryDelegatorValidatorRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// QueryDelegatorValidatorResponse response type for the -// Query/DelegatorValidator RPC method. -message QueryDelegatorValidatorResponse { - // validator defines the validator info. - Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC -// method. -message QueryHistoricalInfoRequest { - // height defines at which height to query the historical info. - int64 height = 1; -} - -// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC -// method. -message QueryHistoricalInfoResponse { - // hist defines the historical info at the given height. - HistoricalInfo hist = 1; -} - -// QueryPoolRequest is request type for the Query/Pool RPC method. -message QueryPoolRequest {} - -// QueryPoolResponse is response type for the Query/Pool RPC method. -message QueryPoolResponse { - // pool defines the pool info. - Pool pool = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto deleted file mode 100644 index e7620c55..00000000 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ /dev/null @@ -1,405 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "amino/amino.proto"; -import "tendermint/types/types.proto"; -import "tendermint/abci/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// HistoricalInfo contains header and validator information for a given block. -// It is stored as part of staking module's state, which persists the `n` most -// recent HistoricalInfo -// (`n` is set by the staking module's `historical_entries` parameter). -message HistoricalInfo { - tendermint.types.Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - repeated Validator valset = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// CommissionRates defines the initial commission rates to be used for creating -// a validator. -message CommissionRates { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - string max_rate = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - string max_change_rate = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Commission defines commission parameters for a given validator. -message Commission { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // commission_rates defines the initial commission rates to be used for creating a validator. - CommissionRates commission_rates = 1 - [(gogoproto.embed) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// Description defines a validator description. -message Description { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // moniker defines a human-readable name for the validator. - string moniker = 1; - // identity defines an optional identity signature (ex. UPort or Keybase). - string identity = 2; - // website defines an optional website link. - string website = 3; - // security_contact defines an optional email for security contact. - string security_contact = 4; - // details define other optional details. - string details = 5; -} - -// Validator defines a validator, together with the total amount of the -// Validator's bond shares and their exchange rate to coins. Slashing results in -// a decrease in the exchange rate, allowing correct calculation of future -// undelegations without iterating over delegators. When coins are delegated to -// this validator, the validator is credited with a delegation whose number of -// bond shares is based on the amount of coins delegated divided by the current -// exchange rate. Voting power can be calculated as total bonded shares -// multiplied by exchange rate. -message Validator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - // operator_address defines the address of the validator's operator; bech encoded in JSON. - string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - // jailed defined whether the validator has been jailed from bonded status or not. - bool jailed = 3; - // status is the validator status (bonded/unbonding/unbonded). - BondStatus status = 4; - // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // delegator_shares defines total shares issued to a validator's delegators. - string delegator_shares = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // description defines the description terms for the validator. - Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - int64 unbonding_height = 8; - // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - // commission defines the commission parameters. - Commission commission = 10 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // min_self_delegation is the validator's self declared minimum self delegation. - // - // Since: cosmos-sdk 0.46 - string min_self_delegation = 11 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // strictly positive if this validator's unbonding has been stopped by external modules - int64 unbonding_on_hold_ref_count = 12; - - // list of unbonding ids, each uniquely identifing an unbonding of this validator - repeated uint64 unbonding_ids = 13; -} - -// BondStatus is the status of a validator. -enum BondStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // UNSPECIFIED defines an invalid validator status. - BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; - // UNBONDED defines a validator that is not bonded. - BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; - // UNBONDING defines a validator that is unbonding. - BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; - // BONDED defines a validator that is bonded. - BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; -} - -// ValAddresses defines a repeated set of validator addresses. -message ValAddresses { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = true; - - repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// DVPair is struct that just has a delegator-validator pair with no other data. -// It is intended to be used as a marshalable pointer. For example, a DVPair can -// be used to construct the key to getting an UnbondingDelegation from state. -message DVPair { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// DVPairs defines an array of DVPair objects. -message DVPairs { - repeated DVPair pairs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// DVVTriplet is struct that just has a delegator-validator-validator triplet -// with no other data. It is intended to be used as a marshalable pointer. For -// example, a DVVTriplet can be used to construct the key to getting a -// Redelegation from state. -message DVVTriplet { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// DVVTriplets defines an array of DVVTriplet objects. -message DVVTriplets { - repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// Delegation represents the bond with tokens held by an account. It is -// owned by one delegator, and is associated with the voting power of one -// validator. -message Delegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // shares define the delegation shares received. - string shares = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// UnbondingDelegation stores all of a single delegator's unbonding bonds -// for a single validator in an time-ordered list. -message UnbondingDelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries -} - -// UnbondingDelegationEntry defines an unbonding object with relevant metadata. -message UnbondingDelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height is the height which the unbonding took place. - int64 creation_height = 1; - // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - // initial_balance defines the tokens initially scheduled to receive at completion. - string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // balance defines the tokens to receive at completion. - string balance = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // Incrementing id that uniquely identifies this entry - uint64 unbonding_id = 5; - - // Strictly positive if this entry's unbonding has been stopped by external modules - int64 unbonding_on_hold_ref_count = 6; -} - -// RedelegationEntry defines a redelegation object with relevant metadata. -message RedelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height defines the height which the redelegation took place. - int64 creation_height = 1; - // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; - // initial_balance defines the initial balance when redelegation started. - string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // Incrementing id that uniquely identifies this entry - uint64 unbonding_id = 5; - - // Strictly positive if this entry's unbonding has been stopped by external modules - int64 unbonding_on_hold_ref_count = 6; -} - -// Redelegation contains the list of a particular delegator's redelegating bonds -// from a particular source validator to a particular destination validator. -message Redelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_src_address is the validator redelegation source operator address. - string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_dst_address is the validator redelegation destination operator address. - string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries -} - -// Params defines the parameters for the x/staking module. -message Params { - option (amino.name) = "cosmos-sdk/x/staking/Params"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; - // max_validators is the maximum number of validators. - uint32 max_validators = 2; - // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - uint32 max_entries = 3; - // historical_entries is the number of historical entries to persist. - uint32 historical_entries = 4; - // bond_denom defines the bondable coin denomination. - string bond_denom = 5; - // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators - string min_commission_rate = 6 [ - (gogoproto.moretags) = "yaml:\"min_commission_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// DelegationResponse is equivalent to Delegation except that it contains a -// balance in addition to shares which is more suitable for client responses. -message DelegationResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - - Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -// contains a balance in addition to shares which is more suitable for client -// responses. -message RedelegationEntryResponse { - option (gogoproto.equal) = true; - - RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string balance = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -// RedelegationResponse is equivalent to a Redelegation except that its entries -// contain a balance in addition to shares which is more suitable for client -// responses. -message RedelegationResponse { - option (gogoproto.equal) = false; - - Redelegation redelegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// Pool is used for tracking bonded and not-bonded token supply of the bond -// denomination. -message Pool { - option (gogoproto.description) = true; - option (gogoproto.equal) = true; - string not_bonded_tokens = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "not_bonded_tokens", - (amino.dont_omitempty) = true - ]; - string bonded_tokens = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "bonded_tokens", - (amino.dont_omitempty) = true - ]; -} - -// Infraction indicates the infraction a validator commited. -enum Infraction { - // UNSPECIFIED defines an empty infraction. - INFRACTION_UNSPECIFIED = 0; - // DOUBLE_SIGN defines a validator that double-signs a block. - INFRACTION_DOUBLE_SIGN = 1; - // DOWNTIME defines a validator that missed signing too many blocks. - INFRACTION_DOWNTIME = 2; -} - -// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. -// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence -message ValidatorUpdates { - repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto deleted file mode 100644 index 42e2218e..00000000 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ /dev/null @@ -1,201 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/staking/v1beta1/staking.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// Msg defines the staking Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // CreateValidator defines a method for creating a new validator. - rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); - - // EditValidator defines a method for editing an existing validator. - rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); - - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); - - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); - - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); - - // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - // and delegate back to previous validator. - // - // Since: cosmos-sdk 0.46 - rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); - - // UpdateParams defines an operation for updating the x/staking module - // parameters. - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgCreateValidator defines a SDK message for creating a new validator. -message MsgCreateValidator { - // NOTE(fdymylja): this is a particular case in which - // if validator_address == delegator_address then only one - // is expected to sign, otherwise both are. - option (cosmos.msg.v1.signer) = "delegator_address"; - option (cosmos.msg.v1.signer) = "validator_address"; - option (amino.name) = "cosmos-sdk/MsgCreateValidator"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string min_self_delegation = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. -message MsgCreateValidatorResponse {} - -// MsgEditValidator defines a SDK message for editing an existing validator. -message MsgEditValidator { - option (cosmos.msg.v1.signer) = "validator_address"; - option (amino.name) = "cosmos-sdk/MsgEditValidator"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // We pass a reference to the new commission rate and min self delegation as - // it's not mandatory to update. If not updated, the deserialized rate will be - // zero with no way to distinguish if an update was intended. - // REF: #2373 - string commission_rate = 3 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; - string min_self_delegation = 4 - [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; -} - -// MsgEditValidatorResponse defines the Msg/EditValidator response type. -message MsgEditValidatorResponse {} - -// MsgDelegate defines a SDK message for performing a delegation of coins -// from a delegator to a validator. -message MsgDelegate { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgDelegate"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgDelegateResponse defines the Msg/Delegate response type. -message MsgDelegateResponse {} - -// MsgBeginRedelegate defines a SDK message for performing a redelegation -// of coins from a delegator and source validator to a destination validator. -message MsgBeginRedelegate { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. -message MsgBeginRedelegateResponse { - google.protobuf.Timestamp completion_time = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// MsgUndelegate defines a SDK message for performing an undelegation from a -// delegate and a validator. -message MsgUndelegate { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgUndelegate"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgUndelegateResponse defines the Msg/Undelegate response type. -message MsgUndelegateResponse { - google.protobuf.Timestamp completion_time = 1 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; -} - -// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator -// -// Since: cosmos-sdk 0.46 -message MsgCancelUnbondingDelegation { - option (cosmos.msg.v1.signer) = "delegator_address"; - option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // amount is always less than or equal to unbonding delegation entry balance - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // creation_height is the height which the unbonding took place. - int64 creation_height = 4; -} - -// MsgCancelUnbondingDelegationResponse -// -// Since: cosmos-sdk 0.46 -message MsgCancelUnbondingDelegationResponse {} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/staking/MsgUpdateParams"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // params defines the x/staking parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -}; - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {}; diff --git a/proto/cosmos/tx/config/v1/config.proto b/proto/cosmos/tx/config/v1/config.proto deleted file mode 100644 index 15553a28..00000000 --- a/proto/cosmos/tx/config/v1/config.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package cosmos.tx.config.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Config is the config object of the x/auth/tx package. -message Config { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/auth/tx" - }; - - // skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override - // this functionality. - bool skip_ante_handler = 1; - - // skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override - // this functionality. - bool skip_post_handler = 2; -} \ No newline at end of file diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto deleted file mode 100644 index 12d5868b..00000000 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ /dev/null @@ -1,106 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.signing.v1beta1; - -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; - -// SignMode represents a signing mode with its own security guarantees. -// -// This enum should be considered a registry of all known sign modes -// in the Cosmos ecosystem. Apps are not expected to support all known -// sign modes. Apps that would like to support custom sign modes are -// encouraged to open a small PR against this file to add a new case -// to this SignMode enum describing their sign mode so that different -// apps have a consistent version of this enum. -enum SignMode { - // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - // rejected. - SIGN_MODE_UNSPECIFIED = 0; - - // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - // verified with raw bytes from Tx. - SIGN_MODE_DIRECT = 1; - - // SIGN_MODE_TEXTUAL is a future signing mode that will verify some - // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT. It is currently not supported. - SIGN_MODE_TEXTUAL = 2; - - // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses - // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. - // - // Since: cosmos-sdk 0.46 - SIGN_MODE_DIRECT_AUX = 3; - - // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - // Amino JSON and will be removed in the future. - SIGN_MODE_LEGACY_AMINO_JSON = 127; - - // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - // - // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - // but is not implemented on the SDK by default. To enable EIP-191, you need - // to pass a custom `TxConfig` that has an implementation of - // `SignModeHandler` for EIP-191. The SDK may decide to fully support - // EIP-191 in the future. - // - // Since: cosmos-sdk 0.45.2 - SIGN_MODE_EIP_191 = 191; -} - -// SignatureDescriptors wraps multiple SignatureDescriptor's. -message SignatureDescriptors { - // signatures are the signature descriptors - repeated SignatureDescriptor signatures = 1; -} - -// SignatureDescriptor is a convenience type which represents the full data for -// a signature including the public key of the signer, signing modes and the -// signature itself. It is primarily used for coordinating signatures between -// clients. -message SignatureDescriptor { - // public_key is the public key of the signer - google.protobuf.Any public_key = 1; - - Data data = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to prevent - // replay attacks. - uint64 sequence = 3; - - // Data represents signature data - message Data { - // sum is the oneof that specifies whether this represents single or multi-signature data - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a multisig signer - Multi multi = 2; - } - - // Single is the signature data for a single signer - message Single { - // mode is the signing mode of the single signer - SignMode mode = 1; - - // signature is the raw signature bytes - bytes signature = 2; - } - - // Multi is the signature data for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // signatures is the signatures of the multi-signature - repeated Data signatures = 2; - } - } -} diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto deleted file mode 100644 index 16b3de0d..00000000 --- a/proto/cosmos/tx/v1beta1/service.proto +++ /dev/null @@ -1,277 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; -import "cosmos/tx/v1beta1/tx.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "tendermint/types/block.proto"; -import "tendermint/types/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Service defines a gRPC service for interacting with transactions. -service Service { - // Simulate simulates executing a transaction for estimating gas usage. - rpc Simulate(SimulateRequest) returns (SimulateResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/simulate" - body: "*" - }; - } - // GetTx fetches a tx by hash. - rpc GetTx(GetTxRequest) returns (GetTxResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; - } - // BroadcastTx broadcast transaction. - rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/txs" - body: "*" - }; - } - // GetTxsEvent fetches txs by event. - rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; - } - // GetBlockWithTxs fetches a block with decoded txs. - // - // Since: cosmos-sdk 0.45.2 - rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; - } - // TxDecode decodes the transaction. - // - // Since: cosmos-sdk 0.47 - rpc TxDecode(TxDecodeRequest) returns (TxDecodeResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/decode" - body: "*" - }; - } - // TxEncode encodes the transaction. - // - // Since: cosmos-sdk 0.47 - rpc TxEncode(TxEncodeRequest) returns (TxEncodeResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/encode" - body: "*" - }; - } - // TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - // - // Since: cosmos-sdk 0.47 - rpc TxEncodeAmino(TxEncodeAminoRequest) returns (TxEncodeAminoResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/encode/amino" - body: "*" - }; - } - // TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - // - // Since: cosmos-sdk 0.47 - rpc TxDecodeAmino(TxDecodeAminoRequest) returns (TxDecodeAminoResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/decode/amino" - body: "*" - }; - } -} - -// GetTxsEventRequest is the request type for the Service.TxsByEvents -// RPC method. -message GetTxsEventRequest { - // events is the list of transaction event type. - repeated string events = 1; - // pagination defines a pagination for the request. - // Deprecated post v0.46.x: use page and limit instead. - cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; - - OrderBy order_by = 3; - // page is the page number to query, starts at 1. If not provided, will default to first page. - uint64 page = 4; - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - uint64 limit = 5; -} - -// OrderBy defines the sorting order -enum OrderBy { - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - ORDER_BY_UNSPECIFIED = 0; - // ORDER_BY_ASC defines ascending order - ORDER_BY_ASC = 1; - // ORDER_BY_DESC defines descending order - ORDER_BY_DESC = 2; -} - -// GetTxsEventResponse is the response type for the Service.TxsByEvents -// RPC method. -message GetTxsEventResponse { - // txs is the list of queried transactions. - repeated cosmos.tx.v1beta1.Tx txs = 1; - // tx_responses is the list of queried TxResponses. - repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; - // pagination defines a pagination for the response. - // Deprecated post v0.46.x: use total instead. - cosmos.base.query.v1beta1.PageResponse pagination = 3 [deprecated = true]; - // total is total number of results available - uint64 total = 4; -} - -// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -// RPC method. -message BroadcastTxRequest { - // tx_bytes is the raw transaction. - bytes tx_bytes = 1; - BroadcastMode mode = 2; -} - -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. -enum BroadcastMode { - // zero-value for mode ordering - BROADCAST_MODE_UNSPECIFIED = 0; - // DEPRECATED: use BROADCAST_MODE_SYNC instead, - // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_BLOCK = 1 [deprecated = true]; - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. - BROADCAST_MODE_SYNC = 2; - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. - BROADCAST_MODE_ASYNC = 3; -} - -// BroadcastTxResponse is the response type for the -// Service.BroadcastTx method. -message BroadcastTxResponse { - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 1; -} - -// SimulateRequest is the request type for the Service.Simulate -// RPC method. -message SimulateRequest { - // tx is the transaction to simulate. - // Deprecated. Send raw tx bytes instead. - cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; - // tx_bytes is the raw transaction. - // - // Since: cosmos-sdk 0.43 - bytes tx_bytes = 2; -} - -// SimulateResponse is the response type for the -// Service.SimulateRPC method. -message SimulateResponse { - // gas_info is the information about gas used in the simulation. - cosmos.base.abci.v1beta1.GasInfo gas_info = 1; - // result is the result of the simulation. - cosmos.base.abci.v1beta1.Result result = 2; -} - -// GetTxRequest is the request type for the Service.GetTx -// RPC method. -message GetTxRequest { - // hash is the tx hash to query, encoded as a hex string. - string hash = 1; -} - -// GetTxResponse is the response type for the Service.GetTx method. -message GetTxResponse { - // tx is the queried transaction. - cosmos.tx.v1beta1.Tx tx = 1; - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 2; -} - -// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs -// RPC method. -// -// Since: cosmos-sdk 0.45.2 -message GetBlockWithTxsRequest { - // height is the height of the block to query. - int64 height = 1; - // pagination defines a pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. -// -// Since: cosmos-sdk 0.45.2 -message GetBlockWithTxsResponse { - // txs are the transactions in the block. - repeated cosmos.tx.v1beta1.Tx txs = 1; - .tendermint.types.BlockID block_id = 2; - .tendermint.types.Block block = 3; - // pagination defines a pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 4; -} - -// TxDecodeRequest is the request type for the Service.TxDecode -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxDecodeRequest { - // tx_bytes is the raw transaction. - bytes tx_bytes = 1; -} - -// TxDecodeResponse is the response type for the -// Service.TxDecode method. -// -// Since: cosmos-sdk 0.47 -message TxDecodeResponse { - // tx is the decoded transaction. - cosmos.tx.v1beta1.Tx tx = 1; -} - -// TxEncodeRequest is the request type for the Service.TxEncode -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxEncodeRequest { - // tx is the transaction to encode. - cosmos.tx.v1beta1.Tx tx = 1; -} - -// TxEncodeResponse is the response type for the -// Service.TxEncode method. -// -// Since: cosmos-sdk 0.47 -message TxEncodeResponse { - // tx_bytes is the encoded transaction bytes. - bytes tx_bytes = 1; -} - -// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxEncodeAminoRequest { - string amino_json = 1; -} - -// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxEncodeAminoResponse { - bytes amino_binary = 1; -} - -// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxDecodeAminoRequest { - bytes amino_binary = 1; -} - -// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino -// RPC method. -// -// Since: cosmos-sdk 0.47 -message TxDecodeAminoResponse { - string amino_json = 1; -} diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto deleted file mode 100644 index a71a3e11..00000000 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ /dev/null @@ -1,256 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/tx/signing/v1beta1/signing.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Tx is the standard type used for broadcasting transactions. -message Tx { - // body is the processable content of the transaction - TxBody body = 1; - - // auth_info is the authorization related content of the transaction, - // specifically signers, signer modes and fee - AuthInfo auth_info = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// TxRaw is a variant of Tx that pins the signer's exact binary representation -// of body and auth_info. This is used for signing, broadcasting and -// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and -// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used -// as the transaction ID. -message TxRaw { - // body_bytes is a protobuf serialization of a TxBody that matches the - // representation in SignDoc. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in SignDoc. - bytes auth_info_bytes = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. -message SignDoc { - // body_bytes is protobuf serialization of a TxBody that matches the - // representation in TxRaw. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in TxRaw. - bytes auth_info_bytes = 2; - - // chain_id is the unique identifier of the chain this transaction targets. - // It prevents signed transactions from being used on another chain by an - // attacker - string chain_id = 3; - - // account_number is the account number of the account in state - uint64 account_number = 4; -} - -// SignDocDirectAux is the type used for generating sign bytes for -// SIGN_MODE_DIRECT_AUX. -// -// Since: cosmos-sdk 0.46 -message SignDocDirectAux { - // body_bytes is protobuf serialization of a TxBody that matches the - // representation in TxRaw. - bytes body_bytes = 1; - - // public_key is the public key of the signing account. - google.protobuf.Any public_key = 2; - - // chain_id is the identifier of the chain this transaction targets. - // It prevents signed transactions from being used on another chain by an - // attacker. - string chain_id = 3; - - // account_number is the account number of the account in state. - uint64 account_number = 4; - - // sequence is the sequence number of the signing account. - uint64 sequence = 5; - - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - Tip tip = 6; -} - -// TxBody is the body of a transaction that all signers sign over. -message TxBody { - // messages is a list of messages to be executed. The required signers of - // those messages define the number and order of elements in AuthInfo's - // signer_infos and Tx's signatures. Each required signer address is added to - // the list only the first time it occurs. - // By convention, the first required signer (usually from the first message) - // is referred to as the primary signer and pays the fee for the whole - // transaction. - repeated google.protobuf.Any messages = 1; - - // memo is any arbitrary note/comment to be added to the transaction. - // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - string memo = 2; - - // timeout is the block height after which this transaction will not - // be processed by the chain - uint64 timeout_height = 3; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, the transaction will be rejected - repeated google.protobuf.Any extension_options = 1023; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, they will be ignored - repeated google.protobuf.Any non_critical_extension_options = 2047; -} - -// AuthInfo describes the fee and signer modes that are used to sign a -// transaction. -message AuthInfo { - // signer_infos defines the signing modes for the required signers. The number - // and order of elements must match the required signers from TxBody's - // messages. The first element is the primary signer and the one which pays - // the fee. - repeated SignerInfo signer_infos = 1; - - // Fee is the fee and gas limit for the transaction. The first signer is the - // primary signer and the one which pays the fee. The fee can be calculated - // based on the cost of evaluating the body and doing signature verification - // of the signers. This can be estimated via simulation. - Fee fee = 2; - - // Tip is the optional tip used for transactions fees paid in another denom. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - // - // Since: cosmos-sdk 0.46 - Tip tip = 3; -} - -// SignerInfo describes the public key and signing mode of a single top-level -// signer. -message SignerInfo { - // public_key is the public key of the signer. It is optional for accounts - // that already exist in state. If unset, the verifier can use the required \ - // signer address for this position and lookup the public key. - google.protobuf.Any public_key = 1; - - // mode_info describes the signing mode of the signer and is a nested - // structure to support nested multisig pubkey's - ModeInfo mode_info = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to - // prevent replay attacks. - uint64 sequence = 3; -} - -// ModeInfo describes the signing mode of a single or nested multisig signer. -message ModeInfo { - // sum is the oneof that specifies whether this represents a single or nested - // multisig signer - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a nested multisig signer - Multi multi = 2; - } - - // Single is the mode info for a single signer. It is structured as a message - // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - // future - message Single { - // mode is the signing mode of the single signer - cosmos.tx.signing.v1beta1.SignMode mode = 1; - } - - // Multi is the mode info for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // mode_infos is the corresponding modes of the signers of the multisig - // which could include nested multisig public keys - repeated ModeInfo mode_infos = 2; - } -} - -// Fee includes the amount of coins paid in fees and the maximum -// gas to be used by the transaction. The ratio yields an effective "gasprice", -// which must be above some miminum to be accepted into the mempool. -message Fee { - // amount is the amount of coins to be paid as a fee - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // gas_limit is the maximum gas that can be used in transaction processing - // before an out of gas error occurs - uint64 gas_limit = 2; - - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. - string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail - string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// Tip is the tip used for meta-transactions. -// -// Since: cosmos-sdk 0.46 -message Tip { - // amount is the amount of the tip - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - // tipper is the address of the account paying for the tip - string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a -// tipper) builds and sends to the fee payer (who will build and broadcast the -// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected -// by the node if sent directly as-is. -// -// Since: cosmos-sdk 0.46 -message AuxSignerData { - // address is the bech32-encoded address of the auxiliary signer. If using - // AuxSignerData across different chains, the bech32 prefix of the target - // chain (where the final transaction is broadcasted) should be used. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer - // signs. Note: we use the same sign doc even if we're signing with - // LEGACY_AMINO_JSON. - SignDocDirectAux sign_doc = 2; - // mode is the signing mode of the single signer. - cosmos.tx.signing.v1beta1.SignMode mode = 3; - // sig is the signature of the sign doc. - bytes sig = 4; -} diff --git a/proto/cosmos/upgrade/module/v1/module.proto b/proto/cosmos/upgrade/module/v1/module.proto deleted file mode 100644 index a4cf5808..00000000 --- a/proto/cosmos/upgrade/module/v1/module.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package cosmos.upgrade.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the upgrade module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/upgrade" - }; - - // authority defines the custom module authority. If not set, defaults to the governance module. - string authority = 1; -} \ No newline at end of file diff --git a/proto/cosmos/upgrade/v1beta1/query.proto b/proto/cosmos/upgrade/v1beta1/query.proto deleted file mode 100644 index 870cf9ee..00000000 --- a/proto/cosmos/upgrade/v1beta1/query.proto +++ /dev/null @@ -1,122 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/upgrade/v1beta1/upgrade.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; - -// Query defines the gRPC upgrade querier service. -service Query { - // CurrentPlan queries the current upgrade plan. - rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; - } - - // AppliedPlan queries a previously applied upgrade plan by its name. - rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; - } - - // UpgradedConsensusState queries the consensus state that will serve - // as a trusted kernel for the next version of this chain. It will only be - // stored at the last height of this chain. - // UpgradedConsensusState RPC not supported with legacy querier - // This rpc is deprecated now that IBC has its own replacement - // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option deprecated = true; - option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; - } - - // ModuleVersions queries the list of module versions from state. - // - // Since: cosmos-sdk 0.43 - rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; - } - - // Returns the account with authority to conduct upgrades - // - // Since: cosmos-sdk 0.46 - rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; - } -} - -// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanRequest {} - -// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanResponse { - // plan is the current upgrade plan. - Plan plan = 1; -} - -// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanRequest { - // name is the name of the applied plan to query for. - string name = 1; -} - -// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanResponse { - // height is the block height at which the plan was applied. - int64 height = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateRequest { - option deprecated = true; - - // last height of the current chain must be sent in request - // as this is the height under which next consensus state is stored - int64 last_height = 1; -} - -// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateResponse { - option deprecated = true; - reserved 1; - - // Since: cosmos-sdk 0.43 - bytes upgraded_consensus_state = 2; -} - -// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsRequest { - // module_name is a field to query a specific module - // consensus version from state. Leaving this empty will - // fetch the full list of module versions from state - string module_name = 1; -} - -// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsResponse { - // module_versions is a list of module names with their consensus versions. - repeated ModuleVersion module_versions = 1; -} - -// QueryAuthorityRequest is the request type for Query/Authority -// -// Since: cosmos-sdk 0.46 -message QueryAuthorityRequest {} - -// QueryAuthorityResponse is the response type for Query/Authority -// -// Since: cosmos-sdk 0.46 -message QueryAuthorityResponse { - string address = 1; -} \ No newline at end of file diff --git a/proto/cosmos/upgrade/v1beta1/tx.proto b/proto/cosmos/upgrade/v1beta1/tx.proto deleted file mode 100644 index 293bea02..00000000 --- a/proto/cosmos/upgrade/v1beta1/tx.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Since: cosmos-sdk 0.46 -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/upgrade/v1beta1/upgrade.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; - -// Msg defines the upgrade Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // SoftwareUpgrade is a governance operation for initiating a software upgrade. - // - // Since: cosmos-sdk 0.46 - rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); - - // CancelUpgrade is a governance operation for cancelling a previously - // approved software upgrade. - // - // Since: cosmos-sdk 0.46 - rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); -} - -// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. -// -// Since: cosmos-sdk 0.46 -message MsgSoftwareUpgrade { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/MsgSoftwareUpgrade"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // plan is the upgrade plan. - Plan plan = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. -// -// Since: cosmos-sdk 0.46 -message MsgSoftwareUpgradeResponse {} - -// MsgCancelUpgrade is the Msg/CancelUpgrade request type. -// -// Since: cosmos-sdk 0.46 -message MsgCancelUpgrade { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/MsgCancelUpgrade"; - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. -// -// Since: cosmos-sdk 0.46 -message MsgCancelUpgradeResponse {} diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto deleted file mode 100644 index 0a967168..00000000 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; -option (gogoproto.goproto_getters_all) = false; - -// Plan specifies information about a planned upgrade and when it should occur. -message Plan { - option (amino.name) = "cosmos-sdk/Plan"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // Sets the name for the upgrade. This name will be used by the upgraded - // version of the software to apply any special "on-upgrade" commands during - // the first BeginBlock method after the upgrade is applied. It is also used - // to detect whether a software version can handle a given upgrade. If no - // upgrade handler with this name has been set in the software, it will be - // assumed that the software is out-of-date when the upgrade Time or Height is - // reached and the software will exit. - string name = 1; - - // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - // has been removed from the SDK. - // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 - [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - - // The height at which the upgrade must be performed. - int64 height = 3; - - // Any application specific upgrade info to be included on-chain - // such as a git commit that validators could automatically upgrade to - string info = 4; - - // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - // moved to the IBC module in the sub module 02-client. - // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; -} - -// SoftwareUpgradeProposal is a gov Content type for initiating a software -// upgrade. -// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -// proposals, see MsgSoftwareUpgrade. -message SoftwareUpgradeProposal { - option deprecated = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // title of the proposal - string title = 1; - - // description of the proposal - string description = 2; - - // plan of the proposal - Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -// upgrade. -// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -// proposals, see MsgCancelUpgrade. -message CancelSoftwareUpgradeProposal { - option deprecated = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // title of the proposal - string title = 1; - - // description of the proposal - string description = 2; -} - -// ModuleVersion specifies a module and its consensus version. -// -// Since: cosmos-sdk 0.43 -message ModuleVersion { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = true; - - // name of the app module - string name = 1; - - // consensus version of the app module - uint64 version = 2; -} diff --git a/proto/cosmos/vesting/module/v1/module.proto b/proto/cosmos/vesting/module/v1/module.proto deleted file mode 100644 index 88bb89c1..00000000 --- a/proto/cosmos/vesting/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.vesting.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the vesting module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/auth/vesting" - }; -} \ No newline at end of file diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto deleted file mode 100644 index 42d3213f..00000000 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ /dev/null @@ -1,100 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/vesting/v1beta1/vesting.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// Msg defines the bank Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // CreateVestingAccount defines a method that enables creating a vesting - // account. - rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); - // CreatePermanentLockedAccount defines a method that enables creating a permanent - // locked account. - // - // Since: cosmos-sdk 0.46 - rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); - // CreatePeriodicVestingAccount defines a method that enables creating a - // periodic vesting account. - // - // Since: cosmos-sdk 0.46 - rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); -} - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -message MsgCreateVestingAccount { - option (cosmos.msg.v1.signer) = "from_address"; - option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount"; - - option (gogoproto.equal) = true; - - string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - // end of vesting as unix time (in seconds). - int64 end_time = 4; - bool delayed = 5; -} - -// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -message MsgCreateVestingAccountResponse {} - -// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent -// locked account. -// -// Since: cosmos-sdk 0.46 -message MsgCreatePermanentLockedAccount { - option (cosmos.msg.v1.signer) = "from_address"; - option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount"; - option (gogoproto.equal) = true; - - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. -// -// Since: cosmos-sdk 0.46 -message MsgCreatePermanentLockedAccountResponse {} - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -// -// Since: cosmos-sdk 0.46 -message MsgCreatePeriodicVestingAccount { - option (cosmos.msg.v1.signer) = "from_address"; - option (amino.name) = "cosmos-sdk/MsgCreatePeriodicVestingAccount"; - - option (gogoproto.equal) = false; - - string from_address = 1; - string to_address = 2; - // start of vesting as unix time (in seconds). - int64 start_time = 3; - repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount -// response type. -// -// Since: cosmos-sdk 0.46 -message MsgCreatePeriodicVestingAccountResponse {} diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto deleted file mode 100644 index 7ab1fb79..00000000 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// BaseVestingAccount implements the VestingAccount interface. It contains all -// the necessary fields needed for any vesting account implementation. -message BaseVestingAccount { - option (amino.name) = "cosmos-sdk/BaseVestingAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - // Vesting end time, as unix timestamp (in seconds). - int64 end_time = 5; -} - -// ContinuousVestingAccount implements the VestingAccount interface. It -// continuously vests by unlocking coins linearly with respect to time. -message ContinuousVestingAccount { - option (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - // Vesting start time, as unix timestamp (in seconds). - int64 start_time = 2; -} - -// DelayedVestingAccount implements the VestingAccount interface. It vests all -// coins after a specific time, but non prior. In other words, it keeps them -// locked until a specified time. -message DelayedVestingAccount { - option (amino.name) = "cosmos-sdk/DelayedVestingAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} - -// Period defines a length of time and amount of coins that will vest. -message Period { - option (gogoproto.goproto_stringer) = false; - - // Period duration in seconds. - int64 length = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// PeriodicVestingAccount implements the VestingAccount interface. It -// periodically vests by unlocking coins during each specified period. -message PeriodicVestingAccount { - option (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2; - repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// PermanentLockedAccount implements the VestingAccount interface. It does -// not ever release coins, locking them indefinitely. Coins in this account can -// still be used for delegating and for governance votes even while locked. -// -// Since: cosmos-sdk 0.43 -message PermanentLockedAccount { - option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} diff --git a/proto/cosmos_proto/cosmos.proto b/proto/cosmos_proto/cosmos.proto deleted file mode 100644 index 5c63b86f..00000000 --- a/proto/cosmos_proto/cosmos.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; -package cosmos_proto; - -import "google/protobuf/descriptor.proto"; - -option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; - -extend google.protobuf.MessageOptions { - - // implements_interface is used to indicate the type name of the interface - // that a message implements so that it can be used in google.protobuf.Any - // fields that accept that interface. A message can implement multiple - // interfaces. Interfaces should be declared using a declare_interface - // file option. - repeated string implements_interface = 93001; -} - -extend google.protobuf.FieldOptions { - - // accepts_interface is used to annotate that a google.protobuf.Any - // field accepts messages that implement the specified interface. - // Interfaces should be declared using a declare_interface file option. - string accepts_interface = 93001; - - // scalar is used to indicate that this field follows the formatting defined - // by the named scalar which should be declared with declare_scalar. Code - // generators may choose to use this information to map this field to a - // language-specific type representing the scalar. - string scalar = 93002; -} - -extend google.protobuf.FileOptions { - - // declare_interface declares an interface type to be used with - // accepts_interface and implements_interface. Interface names are - // expected to follow the following convention such that their declaration - // can be discovered by tools: for a given interface type a.b.C, it is - // expected that the declaration will be found in a protobuf file named - // a/b/interfaces.proto in the file descriptor set. - repeated InterfaceDescriptor declare_interface = 793021; - - // declare_scalar declares a scalar type to be used with - // the scalar field option. Scalar names are - // expected to follow the following convention such that their declaration - // can be discovered by tools: for a given scalar type a.b.C, it is - // expected that the declaration will be found in a protobuf file named - // a/b/scalars.proto in the file descriptor set. - repeated ScalarDescriptor declare_scalar = 793022; -} - -// InterfaceDescriptor describes an interface type to be used with -// accepts_interface and implements_interface and declared by declare_interface. -message InterfaceDescriptor { - - // name is the name of the interface. It should be a short-name (without - // a period) such that the fully qualified name of the interface will be - // package.name, ex. for the package a.b and interface named C, the - // fully-qualified name will be a.b.C. - string name = 1; - - // description is a human-readable description of the interface and its - // purpose. - string description = 2; -} - -// ScalarDescriptor describes an scalar type to be used with -// the scalar field option and declared by declare_scalar. -// Scalars extend simple protobuf built-in types with additional -// syntax and semantics, for instance to represent big integers. -// Scalars should ideally define an encoding such that there is only one -// valid syntactical representation for a given semantic meaning, -// i.e. the encoding should be deterministic. -message ScalarDescriptor { - - // name is the name of the scalar. It should be a short-name (without - // a period) such that the fully qualified name of the scalar will be - // package.name, ex. for the package a.b and scalar named C, the - // fully-qualified name will be a.b.C. - string name = 1; - - // description is a human-readable description of the scalar and its - // encoding format. For instance a big integer or decimal scalar should - // specify precisely the expected encoding format. - string description = 2; - - // field_type is the type of field with which this scalar can be used. - // Scalars can be used with one and only one type of field so that - // encoding standards and simple and clear. Currently only string and - // bytes fields are supported for scalars. - repeated ScalarType field_type = 3; -} - -enum ScalarType { - SCALAR_TYPE_UNSPECIFIED = 0; - SCALAR_TYPE_STRING = 1; - SCALAR_TYPE_BYTES = 2; -} diff --git a/proto/gogoproto/gogo.proto b/proto/gogoproto/gogo.proto deleted file mode 100644 index 974b36a7..00000000 --- a/proto/gogoproto/gogo.proto +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/cosmos/gogoproto -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/cosmos/gogoproto/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - - optional string castrepeated = 65013; -} diff --git a/proto/neutron/dex/deposit_record.proto b/proto/neutron/dex/deposit_record.proto deleted file mode 100644 index f699d554..00000000 --- a/proto/neutron/dex/deposit_record.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "neutron/dex/pair_id.proto"; - -message DepositRecord { - PairID pair_id = 1; - string shares_owned = 2 [ - (gogoproto.moretags) = "yaml:\"shares_owned\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_owned" - ]; - int64 center_tick_index = 3; - int64 lower_tick_index = 4; - int64 upper_tick_index = 5; - uint64 fee = 6; -} diff --git a/proto/neutron/dex/limit_order_expiration.proto b/proto/neutron/dex/limit_order_expiration.proto deleted file mode 100644 index 0057de0d..00000000 --- a/proto/neutron/dex/limit_order_expiration.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "google/protobuf/timestamp.proto"; - -import "gogoproto/gogo.proto"; - -message LimitOrderExpiration { - // see limitOrderTranche.proto for details on goodTilDate - google.protobuf.Timestamp expiration_time = 1 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; - bytes tranche_ref = 2; - -} - diff --git a/proto/neutron/dex/limit_order_tranche.proto b/proto/neutron/dex/limit_order_tranche.proto deleted file mode 100644 index 3bd70b1d..00000000 --- a/proto/neutron/dex/limit_order_tranche.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "google/protobuf/timestamp.proto"; - -import "neutron/dex/trade_pair_id.proto"; -import "gogoproto/gogo.proto"; -import "neutron/dex/pair_id.proto"; - -message LimitOrderTrancheKey { - TradePairID trade_pair_id = 1; - int64 tick_index_taker_to_maker = 2; - string tranche_key = 3; -} - -message LimitOrderTranche { - LimitOrderTrancheKey key = 1; - string reserves_maker_denom = 2 [ - (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserves_maker_denom" - ]; - string reserves_taker_denom = 3 [ - (gogoproto.moretags) = "yaml:\"reserves_taker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserves_taker_denom" - ]; - string total_maker_denom = 4 [ - (gogoproto.moretags) = "yaml:\"total_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "total_maker_denom" - ]; - string total_taker_denom = 5 [ - (gogoproto.moretags) = "yaml:\"total_taker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "total_taker_denom" - ]; - // GoodTilDate is represented as seconds since January 1, year 1, 00:00:00.00 UTC - // LimitOrders with goodTilDate set are valid as long as blockTime <= goodTilDate - - // JIT orders also use goodTilDate to handle deletion but represent a special case - // All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live - // Order deletion still functions the same and the orders will be deleted at the end of the block - google.protobuf.Timestamp expiration_time = 6 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = true - ]; - string price_taker_to_maker = 7 [ - (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" - ]; -} - diff --git a/proto/neutron/dex/limit_order_tranche_user.proto b/proto/neutron/dex/limit_order_tranche_user.proto deleted file mode 100644 index c8aade19..00000000 --- a/proto/neutron/dex/limit_order_tranche_user.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "neutron/dex/trade_pair_id.proto"; -import "neutron/dex/tx.proto"; - -message LimitOrderTrancheUser { - TradePairID trade_pair_id = 1; - int64 tick_index_taker_to_maker = 2; - string tranche_key = 3; - string address = 4; - string shares_owned = 5 [ - (gogoproto.moretags) = "yaml:\"shares_owned\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_owned" - ]; - string shares_withdrawn = 6 [ - (gogoproto.moretags) = "yaml:\"shares_withdrawn\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_withdrawn" - ]; - string shares_cancelled = 7 [ - (gogoproto.moretags) = "yaml:\"shares_cancelled\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_cancelled" - ]; - LimitOrderType order_type = 8; -} - diff --git a/proto/neutron/dex/pair_id.proto b/proto/neutron/dex/pair_id.proto deleted file mode 100644 index e543ba7a..00000000 --- a/proto/neutron/dex/pair_id.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; - -message PairID { - string token0 = 1; - string token1 = 2; -} diff --git a/proto/neutron/dex/params.proto b/proto/neutron/dex/params.proto deleted file mode 100644 index 70c65c29..00000000 --- a/proto/neutron/dex/params.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - repeated uint64 fee_tiers = 1; -} diff --git a/proto/neutron/dex/pool.proto b/proto/neutron/dex/pool.proto deleted file mode 100644 index 5dd76a80..00000000 --- a/proto/neutron/dex/pool.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "neutron/dex/pool_reserves.proto"; - -// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool. - -message Pool { - uint64 id = 1; - PoolReserves lower_tick0 = 2; - PoolReserves upper_tick1 = 3; -} diff --git a/proto/neutron/dex/pool_metadata.proto b/proto/neutron/dex/pool_metadata.proto deleted file mode 100644 index 3e30323c..00000000 --- a/proto/neutron/dex/pool_metadata.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; - -import "neutron/dex/pair_id.proto"; - -message PoolMetadata { - uint64 id = 1; - int64 tick = 2; - uint64 fee = 3; - PairID pair_id = 4; -} diff --git a/proto/neutron/dex/pool_reserves.proto b/proto/neutron/dex/pool_reserves.proto deleted file mode 100644 index 0d489ea9..00000000 --- a/proto/neutron/dex/pool_reserves.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "neutron/dex/trade_pair_id.proto"; - -message PoolReservesKey { - TradePairID trade_pair_id = 1; - int64 tick_index_taker_to_maker = 2; - uint64 fee = 3; -} - -message PoolReserves { - PoolReservesKey key = 1; - string reserves_maker_denom = 2 [ - (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.jsontag) = "reserves_maker_denom", - (gogoproto.nullable) = false - ]; - string price_taker_to_maker = 3 [ - (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" - ]; - string price_opposite_taker_to_maker = 4 [ - (gogoproto.moretags) = "yaml:\"price_opposite_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_opposite_taker_to_maker" - ]; -} - diff --git a/proto/neutron/dex/tick_liquidity.proto b/proto/neutron/dex/tick_liquidity.proto deleted file mode 100644 index 0671e8cf..00000000 --- a/proto/neutron/dex/tick_liquidity.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "neutron/dex/limit_order_tranche.proto"; -import "neutron/dex/pool_reserves.proto"; - - -message TickLiquidity { - oneof liquidity { - PoolReserves pool_reserves = 1; - LimitOrderTranche limit_order_tranche = 2; - } - -} - diff --git a/proto/neutron/dex/trade_pair_id.proto b/proto/neutron/dex/trade_pair_id.proto deleted file mode 100644 index c2f21e8d..00000000 --- a/proto/neutron/dex/trade_pair_id.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; - -message TradePairID { - string maker_denom = 2; - string taker_denom = 3; -} diff --git a/proto/neutron/dex/tx.proto b/proto/neutron/dex/tx.proto deleted file mode 100644 index 41104299..00000000 --- a/proto/neutron/dex/tx.proto +++ /dev/null @@ -1,209 +0,0 @@ -syntax = "proto3"; -package neutron.dex; - -// this line is used by starport scaffolding # proto/tx/import - -option go_package = "github.com/neutron-org/neutron/x/dex/types"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; -import "amino/amino.proto"; -import "neutron/dex/params.proto"; -import "cosmos/msg/v1/msg.proto"; -import "cosmos_proto/cosmos.proto"; - -// Msg defines the Msg service. -service Msg { - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); - rpc Withdrawal(MsgWithdrawal) returns (MsgWithdrawalResponse); - rpc PlaceLimitOrder(MsgPlaceLimitOrder) returns (MsgPlaceLimitOrderResponse); - rpc WithdrawFilledLimitOrder(MsgWithdrawFilledLimitOrder) returns (MsgWithdrawFilledLimitOrderResponse); - rpc CancelLimitOrder(MsgCancelLimitOrder) returns (MsgCancelLimitOrderResponse); - rpc MultiHopSwap(MsgMultiHopSwap) returns (MsgMultiHopSwapResponse); - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -// this line is used by starport scaffolding # proto/tx/rpc -} - -message DepositOptions { - bool disable_autoswap = 1; -} - -message MsgDeposit { - string creator = 1; - string receiver = 2; - string token_a = 3; - string token_b = 4; - repeated string amounts_a = 5 [ - (gogoproto.moretags) = "yaml:\"amounts_a\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amounts_a" - ]; - repeated string amounts_b = 6 [ - (gogoproto.moretags) = "yaml:\"amounts_b\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amounts_b" - ]; - repeated int64 tick_indexes_a_to_b = 7; - repeated uint64 fees = 8; - repeated DepositOptions options = 9; -} - -message MsgDepositResponse { - repeated string reserve0_deposited = 1 [ - (gogoproto.moretags) = "yaml:\"reserve0_deposited\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserve0_deposited" - ]; - repeated string reserve1_deposited = 2[ - (gogoproto.moretags) = "yaml:\"reserve1_deposited\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserve1_deposited" - ]; -} - -message MsgWithdrawal { - string creator = 1; - string receiver = 2; - string token_a = 3; - string token_b = 4; - repeated string shares_to_remove = 5 [ - (gogoproto.moretags) = "yaml:\"shares_to_remove\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_to_remove" - ]; - repeated int64 tick_indexes_a_to_b = 6; - repeated uint64 fees = 7; - -} - -message MsgWithdrawalResponse { -} - -enum LimitOrderType{ - GOOD_TIL_CANCELLED = 0; - FILL_OR_KILL = 1; - IMMEDIATE_OR_CANCEL = 2; - JUST_IN_TIME = 3; - GOOD_TIL_TIME = 4; -} - -message MsgPlaceLimitOrder { - string creator = 1; - string receiver = 2; - string token_in = 3; - string token_out = 4; - int64 tick_index_in_to_out = 5; - string amount_in = 7 [ - (gogoproto.moretags) = "yaml:\"amount_in\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amount_in" - ]; - LimitOrderType order_type = 8; - // expirationTime is only valid iff orderType == GOOD_TIL_TIME. - google.protobuf.Timestamp expiration_time = 9 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = true - ]; - string max_amount_out = 10 [ - (gogoproto.moretags) = "yaml:\"max_amount_out\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = true, - (gogoproto.jsontag) = "max_amount_out" - ]; -} - -message MsgPlaceLimitOrderResponse { - string trancheKey = 1; - // Total amount of coin used for the limit order - cosmos.base.v1beta1.Coin coin_in = 2 [ - (gogoproto.moretags) = "yaml:\"coin_in\"", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "coin_in" - ]; - // Total amount of coin received from the taker portion of the limit order - // This is the amount of coin immediately available in the users account after executing the - // limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future - cosmos.base.v1beta1.Coin taker_coin_out = 3 [ - (gogoproto.moretags) = "yaml:\"taker_coin_out\"", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "taker_coin_out" - ]; - -} - -message MsgWithdrawFilledLimitOrder { - string creator = 1; - string tranche_key = 2; -} - -message MsgWithdrawFilledLimitOrderResponse { -} - -message MsgCancelLimitOrder { - string creator = 1; - string tranche_key = 2; -} - -message MsgCancelLimitOrderResponse { -} - -message MultiHopRoute { - repeated string hops = 1; -} - -message MsgMultiHopSwap { - string creator = 1; - string receiver = 2; - repeated MultiHopRoute routes = 3; - string amount_in = 4 [ - (gogoproto.moretags) = "yaml:\"amount_in\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amount_in" - ]; - string exit_limit_price = 5 [ - (gogoproto.moretags) = "yaml:\"exit_limit_price\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "exit_limit_price" - ]; - // If pickBestRoute == true then all routes are run and the route with the best price is chosen - // otherwise, the first succesful route is used. - bool pick_best_route = 6; -} - -message MsgMultiHopSwapResponse { - cosmos.base.v1beta1.Coin coin_out = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "coin_out" - ]; -} - -message MsgUpdateParams { - option (amino.name) = "dex/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: 0.47 -message MsgUpdateParamsResponse {} - - -// this line is used by starport scaffolding # proto/tx/message From 4e4c3feda5147bf3b991c6b65ccdec6ee4f5ecb4 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Thu, 16 Nov 2023 19:24:49 +0200 Subject: [PATCH 31/77] dex proto --- packages/neutron-sdk/Cargo.toml | 2 + packages/neutron-sdk/src/proto_types/mod.rs | 48 +++- .../{dex => neutron}/NEUTRON_COMMIT | 0 .../src/proto_types/{dex => neutron}/amino.rs | 0 .../{dex => neutron}/cosmos.bank.v1beta1.rs | 0 .../cosmos.base.query.v1beta1.rs | 0 .../{dex => neutron}/cosmos.base.v1beta1.rs | 0 .../{dex => neutron}/cosmos.msg.v1.rs | 0 .../cosmos.upgrade.v1beta1.rs | 0 .../{dex => neutron}/cosmos_proto.rs | 0 .../ibc.applications.transfer.v1.rs | 0 .../ibc.applications.transfer.v1.tonic.rs | 0 .../{dex => neutron}/ibc.core.channel.v1.rs | 0 .../{dex => neutron}/ibc.core.client.v1.rs | 0 .../neutron.contractmanager.rs | 0 .../neutron.contractmanager.tonic.rs | 0 .../neutron.contractmanager.v1.rs | 0 .../{dex => neutron}/neutron.cron.rs | 0 .../{dex => neutron}/neutron.cron.tonic.rs | 0 .../{dex => neutron}/neutron.dex.rs | 0 .../{dex => neutron}/neutron.dex.tonic.rs | 0 .../{dex => neutron}/neutron.feeburner.rs | 0 .../neutron.feeburner.tonic.rs | 0 .../{dex => neutron}/neutron.feerefunder.rs | 0 .../neutron.feerefunder.tonic.rs | 0 .../neutron.interchainqueries.rs | 0 .../neutron.interchainqueries.tonic.rs | 0 .../{dex => neutron}/neutron.interchaintxs.rs | 0 .../neutron.interchaintxs.tonic.rs | 0 .../neutron.interchaintxs.v1.rs | 0 .../neutron.interchaintxs.v1.tonic.rs | 0 .../{dex => neutron}/neutron.transfer.rs | 0 .../neutron.transfer.tonic.rs | 0 .../osmosis.tokenfactory.v1beta1.rs | 0 .../osmosis.tokenfactory.v1beta1.tonic.rs | 0 .../neutron-sdk/src/proto_types/transfer.rs | 217 ------------------ proto-build/src/main.rs | 4 +- 37 files changed, 50 insertions(+), 221 deletions(-) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/NEUTRON_COMMIT (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/amino.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos.bank.v1beta1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos.base.query.v1beta1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos.base.v1beta1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos.msg.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos.upgrade.v1beta1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/cosmos_proto.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/ibc.applications.transfer.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/ibc.applications.transfer.v1.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/ibc.core.channel.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/ibc.core.client.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.contractmanager.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.contractmanager.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.contractmanager.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.cron.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.cron.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.dex.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.dex.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.feeburner.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.feeburner.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.feerefunder.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.feerefunder.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchainqueries.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchainqueries.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchaintxs.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchaintxs.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchaintxs.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.interchaintxs.v1.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.transfer.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/neutron.transfer.tonic.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/osmosis.tokenfactory.v1beta1.rs (100%) rename packages/neutron-sdk/src/proto_types/{dex => neutron}/osmosis.tokenfactory.v1beta1.tonic.rs (100%) delete mode 100644 packages/neutron-sdk/src/proto_types/transfer.rs diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index 0cfe3b75..a4f5f676 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -18,6 +18,8 @@ bech32 = { workspace = true } thiserror = { workspace = true } protobuf = { workspace = true } cosmwasm-schema = { workspace = true } +prost = { workspace = true } +prost-types = { workspace = true } [dev-dependencies] base64 = { workspace = true } diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index cc84d8b2..f57dd279 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -1,2 +1,46 @@ -// @generated -pub mod transfer; +#![allow( + rustdoc::bare_urls, + rustdoc::broken_intra_doc_links, + clippy::derive_partial_eq_without_eq +)] +#![forbid(unsafe_code)] +#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)] + +pub use prost; +pub use prost_types::Any; + +/// The version (commit hash) of the Cosmos SDK used when generating this library. +pub const COSMOS_SDK_VERSION: &str = include_str!("neutron/NEUTRON_COMMIT"); + +pub mod neutron { + pub mod dex { + include!("neutron/neutron.dex.rs"); + } +} + +/// Cosmos protobuf definitions. +pub mod cosmos { + pub mod dex { + include!("neutron/neutron.dex.rs"); + } + + pub mod base { + pub mod v1beta1 { + include!("neutron/cosmos.base.v1beta1.rs"); + } + + /// Query support. + pub mod query { + pub mod v1beta1 { + include!("neutron/cosmos.base.query.v1beta1.rs"); + } + } + + /// Services for the upgrade module. + pub mod upgrade { + pub mod v1beta1 { + include!("neutron/cosmos.upgrade.v1beta1.rs"); + } + } + } +} diff --git a/packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/NEUTRON_COMMIT rename to packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT diff --git a/packages/neutron-sdk/src/proto_types/dex/amino.rs b/packages/neutron-sdk/src/proto_types/neutron/amino.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/amino.rs rename to packages/neutron-sdk/src/proto_types/neutron/amino.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos.bank.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos.base.query.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos.base.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos.msg.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos.upgrade.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/cosmos_proto.rs rename to packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/ibc.applications.transfer.v1.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/ibc.core.channel.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/ibc.core.client.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.contractmanager.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.cron.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.cron.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.cron.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.dex.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.dex.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.dex.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.feeburner.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.feerefunder.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchainqueries.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.interchaintxs.v1.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.transfer.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/neutron.transfer.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.rs diff --git a/packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/dex/osmosis.tokenfactory.v1beta1.tonic.rs rename to packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs diff --git a/packages/neutron-sdk/src/proto_types/transfer.rs b/packages/neutron-sdk/src/proto_types/transfer.rs deleted file mode 100644 index 3133d6a4..00000000 --- a/packages/neutron-sdk/src/proto_types/transfer.rs +++ /dev/null @@ -1,217 +0,0 @@ -// This file is generated by rust-protobuf 3.3.0. Do not edit -// .proto file is parsed by protoc --rust-out=... -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_results)] -#![allow(unused_mut)] - -//! Generated file from `transfer/v1/transfer.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0; - -/// MsgTransferResponse is the modified response type for -/// ibc-go MsgTransfer. -// @@protoc_insertion_point(message:neutron.transfer.MsgTransferResponse) -#[derive(PartialEq,Clone,Default,Debug)] -pub struct MsgTransferResponse { - // message fields - /// channel's sequence_id for outgoing ibc packet. Unique per a channel. - // @@protoc_insertion_point(field:neutron.transfer.MsgTransferResponse.sequence_id) - pub sequence_id: u64, - /// channel src channel on neutron side transaction was submitted from - // @@protoc_insertion_point(field:neutron.transfer.MsgTransferResponse.channel) - pub channel: ::std::string::String, - // special fields - // @@protoc_insertion_point(special_field:neutron.transfer.MsgTransferResponse.special_fields) - pub special_fields: ::protobuf::SpecialFields, -} - -impl<'a> ::std::default::Default for &'a MsgTransferResponse { - fn default() -> &'a MsgTransferResponse { - ::default_instance() - } -} - -impl MsgTransferResponse { - pub fn new() -> MsgTransferResponse { - ::std::default::Default::default() - } - - fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData { - let mut fields = ::std::vec::Vec::with_capacity(2); - let mut oneofs = ::std::vec::Vec::with_capacity(0); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "sequence_id", - |m: &MsgTransferResponse| { &m.sequence_id }, - |m: &mut MsgTransferResponse| { &mut m.sequence_id }, - )); - fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>( - "channel", - |m: &MsgTransferResponse| { &m.channel }, - |m: &mut MsgTransferResponse| { &mut m.channel }, - )); - ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::( - "MsgTransferResponse", - fields, - oneofs, - ) - } -} - -impl ::protobuf::Message for MsgTransferResponse { - const NAME: &'static str = "MsgTransferResponse"; - - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> { - while let Some(tag) = is.read_raw_tag_or_eof()? { - match tag { - 8 => { - self.sequence_id = is.read_uint64()?; - }, - 18 => { - self.channel = is.read_string()?; - }, - tag => { - ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u64 { - let mut my_size = 0; - if self.sequence_id != 0 { - my_size += ::protobuf::rt::uint64_size(1, self.sequence_id); - } - if !self.channel.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.channel); - } - my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); - self.special_fields.cached_size().set(my_size as u32); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - if self.sequence_id != 0 { - os.write_uint64(1, self.sequence_id)?; - } - if !self.channel.is_empty() { - os.write_string(2, &self.channel)?; - } - os.write_unknown_fields(self.special_fields.unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn special_fields(&self) -> &::protobuf::SpecialFields { - &self.special_fields - } - - fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields { - &mut self.special_fields - } - - fn new() -> MsgTransferResponse { - MsgTransferResponse::new() - } - - fn clear(&mut self) { - self.sequence_id = 0; - self.channel.clear(); - self.special_fields.clear(); - } - - fn default_instance() -> &'static MsgTransferResponse { - static instance: MsgTransferResponse = MsgTransferResponse { - sequence_id: 0, - channel: ::std::string::String::new(), - special_fields: ::protobuf::SpecialFields::new(), - }; - &instance - } -} - -impl ::protobuf::MessageFull for MsgTransferResponse { - fn descriptor() -> ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new(); - descriptor.get(|| file_descriptor().message_by_package_relative_name("MsgTransferResponse").unwrap()).clone() - } -} - -impl ::std::fmt::Display for MsgTransferResponse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MsgTransferResponse { - type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1atransfer/v1/transfer.proto\x12\x10neutron.transfer\"P\n\x13MsgTran\ - sferResponse\x12\x1f\n\x0bsequence_id\x18\x01\x20\x01(\x04R\nsequenceId\ - \x12\x18\n\x07channel\x18\x02\x20\x01(\tR\x07channelJ\xfe\x02\n\x06\x12\ - \x04\0\0\x0b\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\ - \x02\0\x19\nX\n\x02\x04\0\x12\x04\x06\0\x0b\x01\x1aL\x20MsgTransferRespo\ - nse\x20is\x20the\x20modified\x20response\x20type\x20for\n\x20ibc-go\x20M\ - sgTransfer.\n\n\n\n\x03\x04\0\x01\x12\x03\x06\x08\x1b\nS\n\x04\x04\0\x02\ - \0\x12\x03\x08\x02\x19\x1aF\x20channel's\x20sequence_id\x20for\x20outgoi\ - ng\x20ibc\x20packet.\x20Unique\x20per\x20a\x20channel.\n\n\x0c\n\x05\x04\ - \0\x02\0\x05\x12\x03\x08\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x08\ - \t\x14\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x08\x17\x18\nQ\n\x04\x04\0\ - \x02\x01\x12\x03\n\x02\x15\x1aD\x20channel\x20src\x20channel\x20on\x20ne\ - utron\x20side\x20transaction\x20was\x20submitted\x20from\n\n\x0c\n\x05\ - \x04\0\x02\x01\x05\x12\x03\n\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\ - \x03\n\t\x10\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\n\x13\x14b\x06proto3\ -"; - -/// `FileDescriptorProto` object which was a source for this generated file -fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new(); - file_descriptor_proto_lazy.get(|| { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() - }) -} - -/// `FileDescriptor` object which allows dynamic access to files -pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor { - static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new(); - static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new(); - file_descriptor.get(|| { - let generated_file_descriptor = generated_file_descriptor_lazy.get(|| { - let mut deps = ::std::vec::Vec::with_capacity(0); - let mut messages = ::std::vec::Vec::with_capacity(1); - messages.push(MsgTransferResponse::generated_message_descriptor_data()); - let mut enums = ::std::vec::Vec::with_capacity(0); - ::protobuf::reflect::GeneratedFileDescriptor::new_generated( - file_descriptor_proto(), - deps, - messages, - enums, - ) - }); - ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor) - }) -} diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index d7fabf40..b9c420da 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -69,7 +69,7 @@ fn main() { output_neutron_version(&temp_neutron_dir); compile_neutron_proto_and_services(&temp_neutron_dir); - copy_generated_files(&temp_neutron_dir, &proto_dir.join("dex")); + copy_generated_files(&temp_neutron_dir, &proto_dir.join("neutron")); // apply_patches(&proto_dir); @@ -179,7 +179,7 @@ fn compile_neutron_proto_and_services(out_dir: &Path) { let proto_path = sdk_dir.join("proto"); let proto_paths = [ // format!("{}/third_party/proto/ibc", sdk_dir.display()), - format!("{}/proto/neutron/dex", sdk_dir.display()), + // format!("{}/proto/neutron/dex", sdk_dir.display()), ]; // List available proto files From 010da0827c3851a56b43d099a058e4c9b3ad2efb Mon Sep 17 00:00:00 2001 From: Neutron Node User Date: Thu, 23 Nov 2023 08:24:38 +0000 Subject: [PATCH 32/77] regenerate neutron protos and expose them in mod --- .../src/proto_types/NEUTRON_COMMIT | 1 + packages/neutron-sdk/src/proto_types/mod.rs | 69 +- .../{neutron => }/neutron.contractmanager.rs | 6 +- .../neutron.contractmanager.v1.rs | 0 .../proto_types/{neutron => }/neutron.cron.rs | 6 +- .../proto_types/{neutron => }/neutron.dex.rs | 61 +- .../{neutron => }/neutron.feeburner.rs | 3 +- .../{neutron => }/neutron.feerefunder.rs | 7 +- .../neutron.interchainqueries.rs | 10 +- .../{neutron => }/neutron.interchaintxs.rs | 3 +- .../{neutron => }/neutron.interchaintxs.v1.rs | 3 +- .../{neutron => }/neutron.transfer.rs | 3 +- .../src/proto_types/neutron/NEUTRON_COMMIT | 1 - .../src/proto_types/neutron/amino.rs | 2 - .../neutron/cosmos.bank.v1beta1.rs | 106 --- .../neutron/cosmos.base.query.v1beta1.rs | 56 -- .../neutron/cosmos.base.v1beta1.rs | 36 - .../src/proto_types/neutron/cosmos.msg.v1.rs | 2 - .../neutron/cosmos.upgrade.v1beta1.rs | 75 -- .../src/proto_types/neutron/cosmos_proto.rs | 64 -- .../neutron/ibc.applications.transfer.v1.rs | 124 ---- .../ibc.applications.transfer.v1.tonic.rs | 222 ------ .../neutron/ibc.core.channel.v1.rs | 207 ------ .../proto_types/neutron/ibc.core.client.v1.rs | 102 --- .../neutron/neutron.contractmanager.tonic.rs | 277 -------- .../proto_types/neutron/neutron.cron.tonic.rs | 246 ------- .../proto_types/neutron/neutron.dex.tonic.rs | 668 ------------------ .../neutron/neutron.feeburner.tonic.rs | 238 ------- .../neutron/neutron.feerefunder.tonic.rs | 228 ------ .../neutron.interchainqueries.tonic.rs | 400 ----------- .../neutron/neutron.interchaintxs.tonic.rs | 131 ---- .../neutron/neutron.interchaintxs.v1.tonic.rs | 150 ---- .../neutron/neutron.transfer.tonic.rs | 296 -------- .../osmosis.tokenfactory.v1beta1.tonic.rs | 435 ------------ .../osmosis.tokenfactory.v1beta1.rs | 12 +- 35 files changed, 94 insertions(+), 4156 deletions(-) create mode 100644 packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.contractmanager.rs (93%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.contractmanager.v1.rs (100%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.cron.rs (94%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.dex.rs (90%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.feeburner.rs (96%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.feerefunder.rs (92%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.interchainqueries.rs (96%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.interchaintxs.rs (93%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.interchaintxs.v1.rs (95%) rename packages/neutron-sdk/src/proto_types/{neutron => }/neutron.transfer.rs (93%) delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/amino.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs delete mode 100644 packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs rename packages/neutron-sdk/src/proto_types/{neutron => }/osmosis.tokenfactory.v1beta1.rs (94%) diff --git a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT new file mode 100644 index 00000000..40916b27 --- /dev/null +++ b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT @@ -0,0 +1 @@ +5845ebddc3f85802fd35661f78efd2c7b61e4724 \ No newline at end of file diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index f57dd279..eca6f66c 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -1,46 +1,47 @@ -#![allow( - rustdoc::bare_urls, - rustdoc::broken_intra_doc_links, - clippy::derive_partial_eq_without_eq -)] -#![forbid(unsafe_code)] -#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)] +pub mod neutron { + pub mod dex { + include!("neutron.dex.rs"); + } + pub mod interchaintxs { + include!("neutron.interchaintxs.rs"); + pub mod v1 { + include!("neutron.interchaintxs.v1.rs"); + } + } + pub mod feeburner { + include!("neutron.feeburner.rs"); + } -pub use prost; -pub use prost_types::Any; + pub mod interchainqueries { + include!("neutron.interchainqueries.rs"); + } -/// The version (commit hash) of the Cosmos SDK used when generating this library. -pub const COSMOS_SDK_VERSION: &str = include_str!("neutron/NEUTRON_COMMIT"); + pub mod cron { + include!("neutron.cron.rs"); + } + pub mod transfer { + include!("neutron.transfer.rs"); + } -pub mod neutron { - pub mod dex { - include!("neutron/neutron.dex.rs"); + pub mod feerefunder { + include!("neutron.feerefunder.rs"); + } + + pub mod contractmanager { + include!("neutron.contractmanager.rs"); } } -/// Cosmos protobuf definitions. -pub mod cosmos { - pub mod dex { - include!("neutron/neutron.dex.rs"); +pub mod contractmanager { + pub mod v1 { + include!("neutron.contractmanager.v1.rs"); } +} - pub mod base { +pub mod osmosis { + pub mod tokenfactory { pub mod v1beta1 { - include!("neutron/cosmos.base.v1beta1.rs"); - } - - /// Query support. - pub mod query { - pub mod v1beta1 { - include!("neutron/cosmos.base.query.v1beta1.rs"); - } - } - - /// Services for the upgrade module. - pub mod upgrade { - pub mod v1beta1 { - include!("neutron/cosmos.upgrade.v1beta1.rs"); - } + include!("osmosis.tokenfactory.v1beta1.rs"); } } } diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.rs b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs similarity index 93% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.rs rename to packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs index f4150e15..444e6fa7 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs @@ -54,7 +54,8 @@ pub struct QueryFailuresRequest { #[prost(uint64, tag = "2")] pub failure_id: u64, #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } /// QueryFailuresResponse is response type for the Query/Failures RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -63,7 +64,7 @@ pub struct QueryFailuresResponse { pub failures: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } /// MsgUpdateParams is the MsgUpdateParams request type. /// @@ -85,5 +86,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("neutron.contractmanager.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.v1.rs b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.rs b/packages/neutron-sdk/src/proto_types/neutron.cron.rs similarity index 94% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.cron.rs rename to packages/neutron-sdk/src/proto_types/neutron.cron.rs index 9361bb03..29816935 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.cron.rs @@ -69,7 +69,8 @@ pub struct QueryGetScheduleResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySchedulesRequest { #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySchedulesResponse { @@ -77,7 +78,7 @@ pub struct QuerySchedulesResponse { pub schedules: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } // this line is used by starport scaffolding # proto/tx/message @@ -101,5 +102,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("neutron.cron.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.rs b/packages/neutron-sdk/src/proto_types/neutron.dex.rs similarity index 90% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.dex.rs rename to packages/neutron-sdk/src/proto_types/neutron.dex.rs index 708ec656..b50edc4c 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.dex.rs @@ -26,6 +26,8 @@ pub struct DepositRecord { pub struct Params { #[prost(uint64, repeated, tag = "1")] pub fee_tiers: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub max_true_taker_spread: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct TradePairId { @@ -114,12 +116,12 @@ pub struct MsgPlaceLimitOrderResponse { pub tranche_key: ::prost::alloc::string::String, /// Total amount of coin used for the limit order #[prost(message, optional, tag = "2")] - pub coin_in: ::core::option::Option, + pub coin_in: ::core::option::Option, /// Total amount of coin received from the taker portion of the limit order /// This is the amount of coin immediately available in the users account after executing the /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future #[prost(message, optional, tag = "3")] - pub taker_coin_out: ::core::option::Option, + pub taker_coin_out: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawFilledLimitOrder { @@ -157,14 +159,14 @@ pub struct MsgMultiHopSwap { #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, /// If pickBestRoute == true then all routes are run and the route with the best price is chosen - /// otherwise, the first successful route is used. + /// otherwise, the first succesful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiHopSwapResponse { #[prost(message, optional, tag = "1")] - pub coin_out: ::core::option::Option, + pub coin_out: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -362,7 +364,8 @@ pub struct QueryGetLimitOrderTrancheUserResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllLimitOrderTrancheUserRequest { #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllLimitOrderTrancheUserResponse { @@ -370,7 +373,7 @@ pub struct QueryAllLimitOrderTrancheUserResponse { pub limit_order_tranche_user: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGetLimitOrderTrancheRequest { @@ -395,7 +398,8 @@ pub struct QueryAllLimitOrderTrancheRequest { #[prost(string, tag = "2")] pub token_in: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllLimitOrderTrancheResponse { @@ -403,14 +407,15 @@ pub struct QueryAllLimitOrderTrancheResponse { pub limit_order_tranche: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllUserDepositsRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllUserDepositsResponse { @@ -418,14 +423,15 @@ pub struct QueryAllUserDepositsResponse { pub deposits: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllUserLimitOrdersRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllUserLimitOrdersResponse { @@ -433,7 +439,7 @@ pub struct QueryAllUserLimitOrdersResponse { pub limit_orders: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllTickLiquidityRequest { @@ -442,7 +448,8 @@ pub struct QueryAllTickLiquidityRequest { #[prost(string, tag = "2")] pub token_in: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllTickLiquidityResponse { @@ -450,7 +457,7 @@ pub struct QueryAllTickLiquidityResponse { pub tick_liquidity: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGetInactiveLimitOrderTrancheRequest { @@ -471,7 +478,8 @@ pub struct QueryGetInactiveLimitOrderTrancheResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllInactiveLimitOrderTrancheRequest { #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllInactiveLimitOrderTrancheResponse { @@ -479,7 +487,7 @@ pub struct QueryAllInactiveLimitOrderTrancheResponse { pub inactive_limit_order_tranche: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPoolReservesRequest { @@ -488,7 +496,8 @@ pub struct QueryAllPoolReservesRequest { #[prost(string, tag = "2")] pub token_in: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPoolReservesResponse { @@ -496,7 +505,7 @@ pub struct QueryAllPoolReservesResponse { pub pool_reserves: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGetPoolReservesRequest { @@ -527,14 +536,14 @@ pub struct QueryEstimateMultiHopSwapRequest { #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, /// If pickBestRoute == true then all routes are run and the route with the best price is chosen - /// otherwise, the first successful route is used. + /// otherwise, the first succesful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimateMultiHopSwapResponse { #[prost(message, optional, tag = "1")] - pub coin_out: ::core::option::Option, + pub coin_out: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimatePlaceLimitOrderRequest { @@ -563,15 +572,15 @@ pub struct QueryEstimatePlaceLimitOrderResponse { /// Total amount of coin used for the limit order /// You can derive makerLimitInCoin using the equation: totalInCoin = swapInCoin + makerLimitInCoin #[prost(message, optional, tag = "1")] - pub total_in_coin: ::core::option::Option, + pub total_in_coin: ::core::option::Option, /// Total amount of the token in that was immediately swapped for swapOutCoin #[prost(message, optional, tag = "2")] - pub swap_in_coin: ::core::option::Option, + pub swap_in_coin: ::core::option::Option, /// Total amount of coin received from the taker portion of the limit order /// This is the amount of coin immediately available in the users account after executing the /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future #[prost(message, optional, tag = "3")] - pub swap_out_coin: ::core::option::Option, + pub swap_out_coin: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolRequest { @@ -605,7 +614,8 @@ pub struct QueryGetPoolMetadataResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPoolMetadataRequest { #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPoolMetadataResponse { @@ -613,7 +623,6 @@ pub struct QueryAllPoolMetadataResponse { pub pool_metadata: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } -include!("neutron.dex.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.rs b/packages/neutron-sdk/src/proto_types/neutron.feeburner.rs similarity index 96% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.rs rename to packages/neutron-sdk/src/proto_types/neutron.feeburner.rs index 312b962a..b1581e35 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.feeburner.rs @@ -17,7 +17,7 @@ pub struct Params { #[derive(Clone, PartialEq, ::prost::Message)] pub struct TotalBurnedNeutronsAmount { #[prost(message, optional, tag = "1")] - pub coin: ::core::option::Option, + pub coin: ::core::option::Option, } /// GenesisState defines the feeburner module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] @@ -69,5 +69,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("neutron.feeburner.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.rs b/packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs similarity index 92% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.rs rename to packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs index bced97e0..3e4b1ac8 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs @@ -4,13 +4,13 @@ pub struct Fee { /// the packet receive fee #[prost(message, repeated, tag = "1")] - pub recv_fee: ::prost::alloc::vec::Vec, + pub recv_fee: ::prost::alloc::vec::Vec, /// the packet acknowledgement fee #[prost(message, repeated, tag = "2")] - pub ack_fee: ::prost::alloc::vec::Vec, + pub ack_fee: ::prost::alloc::vec::Vec, /// the packet timeout fee #[prost(message, repeated, tag = "3")] - pub timeout_fee: ::prost::alloc::vec::Vec, + pub timeout_fee: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketId { @@ -89,5 +89,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("neutron.feerefunder.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.rs b/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs similarity index 96% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs index b31c0830..47f66463 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs @@ -8,7 +8,7 @@ pub struct Params { pub query_submit_timeout: u64, /// Amount of coins deposited for the query. #[prost(message, repeated, tag = "2")] - pub query_deposit: ::prost::alloc::vec::Vec, + pub query_deposit: ::prost::alloc::vec::Vec, /// Amount of tx hashes to be removed during a single EndBlock. Can vary to /// balance between network cleaning speed and EndBlock duration. A zero value /// means no limit. @@ -47,7 +47,7 @@ pub struct RegisteredQuery { ::core::option::Option, /// Amount of coins deposited for the query. #[prost(message, repeated, tag = "10")] - pub deposit: ::prost::alloc::vec::Vec, + pub deposit: ::prost::alloc::vec::Vec, /// Timeout before query becomes available for everybody to remove. #[prost(uint64, tag = "11")] pub submit_timeout: u64, @@ -236,7 +236,8 @@ pub struct QueryRegisteredQueriesRequest { #[prost(string, tag = "2")] pub connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option, + pub pagination: + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRegisteredQueriesResponse { @@ -245,7 +246,7 @@ pub struct QueryRegisteredQueriesResponse { /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: - ::core::option::Option, + ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRegisteredQueryRequest { @@ -286,5 +287,4 @@ pub struct QueryLastRemoteHeightResponse { #[prost(uint64, tag = "1")] pub height: u64, } -include!("neutron.interchainqueries.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs similarity index 93% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs index 5af47567..be2f234d 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs @@ -7,7 +7,7 @@ pub struct Params { pub msg_submit_tx_max_messages: u64, /// Defines a minimum fee required to register interchain account #[prost(message, repeated, tag = "2")] - pub register_fee: ::prost::alloc::vec::Vec, + pub register_fee: ::prost::alloc::vec::Vec, } /// GenesisState defines the interchaintxs module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] @@ -47,5 +47,4 @@ pub struct QueryInterchainAccountAddressResponse { #[prost(string, tag = "1")] pub interchain_account_address: ::prost::alloc::string::String, } -include!("neutron.interchaintxs.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs similarity index 95% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs index 005c33aa..45b47bd7 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs @@ -9,7 +9,7 @@ pub struct MsgRegisterInterchainAccount { #[prost(string, tag = "3")] pub interchain_account_id: ::prost::alloc::string::String, #[prost(message, repeated, tag = "4")] - pub register_fee: ::prost::alloc::vec::Vec, + pub register_fee: ::prost::alloc::vec::Vec, } /// MsgRegisterInterchainAccountResponse is the response type for /// MsgRegisterInterchainAccount. @@ -68,5 +68,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("neutron.interchaintxs.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.rs b/packages/neutron-sdk/src/proto_types/neutron.transfer.rs similarity index 93% rename from packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.rs rename to packages/neutron-sdk/src/proto_types/neutron.transfer.rs index c1c70ef4..33f4fece 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.transfer.rs @@ -9,7 +9,7 @@ pub struct MsgTransfer { pub source_channel: ::prost::alloc::string::String, /// the tokens to be transferred #[prost(message, optional, tag = "3")] - pub token: ::core::option::Option, + pub token: ::core::option::Option, /// the sender address #[prost(string, tag = "4")] pub sender: ::prost::alloc::string::String, @@ -40,5 +40,4 @@ pub struct MsgTransferResponse { #[prost(string, tag = "2")] pub channel: ::prost::alloc::string::String, } -include!("neutron.transfer.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT deleted file mode 100644 index 8febfb61..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/NEUTRON_COMMIT +++ /dev/null @@ -1 +0,0 @@ -83770b74d18b5f5e90c7b0514c7e13a0558af30a \ No newline at end of file diff --git a/packages/neutron-sdk/src/proto_types/neutron/amino.rs b/packages/neutron-sdk/src/proto_types/neutron/amino.rs deleted file mode 100644 index 8e2ac1be..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/amino.rs +++ /dev/null @@ -1,2 +0,0 @@ -// @generated -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs deleted file mode 100644 index 6e98a26f..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos.bank.v1beta1.rs +++ /dev/null @@ -1,106 +0,0 @@ -// @generated -/// Params defines the parameters for the bank module. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// Deprecated: Use of SendEnabled in params is deprecated. - /// For genesis, use the newly added send_enabled field in the genesis object. - /// Storage, lookup, and manipulation of this information is now in the keeper. - /// - /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. - #[deprecated] - #[prost(message, repeated, tag = "1")] - pub send_enabled: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "2")] - pub default_send_enabled: bool, -} -/// SendEnabled maps coin denom to a send_enabled status (whether a denom is -/// sendable). -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SendEnabled { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub enabled: bool, -} -/// Input models transaction input. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Input { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -/// Output models transaction outputs. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Output { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -/// Supply represents a struct that passively keeps track of the total supply -/// amounts in the network. -/// This message is deprecated now that supply is indexed by denom. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Supply { - #[prost(message, repeated, tag = "1")] - pub total: ::prost::alloc::vec::Vec, -} -/// DenomUnit represents a struct that describes a given -/// denomination unit of the basic token. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DenomUnit { - /// denom represents the string name of the given denom unit (e.g uatom). - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - /// exponent represents power of 10 exponent that one must - /// raise the base_denom to in order to equal the given DenomUnit's denom - /// 1 denom = 10^exponent base_denom - /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - /// exponent = 6, thus: 1 atom = 10^6 uatom). - #[prost(uint32, tag = "2")] - pub exponent: u32, - /// aliases is a list of string aliases for the given denom - #[prost(string, repeated, tag = "3")] - pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Metadata represents a struct that describes -/// a basic token. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, - /// denom_units represents the list of DenomUnit's for a given coin - #[prost(message, repeated, tag = "2")] - pub denom_units: ::prost::alloc::vec::Vec, - /// base represents the base denom (should be the DenomUnit with exponent = 0). - #[prost(string, tag = "3")] - pub base: ::prost::alloc::string::String, - /// display indicates the suggested denom that should be - /// displayed in clients. - #[prost(string, tag = "4")] - pub display: ::prost::alloc::string::String, - /// name defines the name of the token (eg: Cosmos Atom) - /// - /// Since: cosmos-sdk 0.43 - #[prost(string, tag = "5")] - pub name: ::prost::alloc::string::String, - /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - /// be the same as the display. - /// - /// Since: cosmos-sdk 0.43 - #[prost(string, tag = "6")] - pub symbol: ::prost::alloc::string::String, - /// URI to a document (on or off-chain) that contains additional information. Optional. - /// - /// Since: cosmos-sdk 0.46 - #[prost(string, tag = "7")] - pub uri: ::prost::alloc::string::String, - /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - /// the document didn't change. Optional. - /// - /// Since: cosmos-sdk 0.46 - #[prost(string, tag = "8")] - pub uri_hash: ::prost::alloc::string::String, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs deleted file mode 100644 index f37d3872..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.query.v1beta1.rs +++ /dev/null @@ -1,56 +0,0 @@ -// @generated -/// PageRequest is to be embedded in gRPC request messages for efficient -/// pagination. Ex: -/// -/// message SomeRequest { -/// Foo some_parameter = 1; -/// PageRequest pagination = 2; -/// } -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageRequest { - /// key is a value returned in PageResponse.next_key to begin - /// querying the next page most efficiently. Only one of offset or key - /// should be set. - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - /// offset is a numeric offset that can be used when key is unavailable. - /// It is less efficient than using key. Only one of offset or key should - /// be set. - #[prost(uint64, tag = "2")] - pub offset: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. - #[prost(uint64, tag = "3")] - pub limit: u64, - /// count_total is set to true to indicate that the result set should include - /// a count of the total number of items available for pagination in UIs. - /// count_total is only respected when offset is used. It is ignored when key - /// is set. - #[prost(bool, tag = "4")] - pub count_total: bool, - /// reverse is set to true if results are to be returned in the descending order. - /// - /// Since: cosmos-sdk 0.43 - #[prost(bool, tag = "5")] - pub reverse: bool, -} -/// PageResponse is to be embedded in gRPC response messages where the -/// corresponding request message has used PageRequest. -/// -/// message SomeResponse { -/// repeated Bar results = 1; -/// PageResponse page = 2; -/// } -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageResponse { - /// next_key is the key to be passed to PageRequest.key to - /// query the next page most efficiently. It will be empty if - /// there are no more results. - #[prost(bytes = "vec", tag = "1")] - pub next_key: ::prost::alloc::vec::Vec, - /// total is total number of results available if PageRequest.count_total - /// was set, its value is undefined otherwise - #[prost(uint64, tag = "2")] - pub total: u64, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs deleted file mode 100644 index cc4421b2..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos.base.v1beta1.rs +++ /dev/null @@ -1,36 +0,0 @@ -// @generated -/// Coin defines a token with a denomination and an amount. -/// -/// NOTE: The amount field is an Int which implements the custom method -/// signatures required by gogoproto. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Coin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// DecCoin defines a token with a denomination and a decimal amount. -/// -/// NOTE: The amount field is an Dec which implements the custom method -/// signatures required by gogoproto. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecCoin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// IntProto defines a Protobuf wrapper around an Int object. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IntProto { - #[prost(string, tag = "1")] - pub int: ::prost::alloc::string::String, -} -/// DecProto defines a Protobuf wrapper around a Dec object. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecProto { - #[prost(string, tag = "1")] - pub dec: ::prost::alloc::string::String, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs deleted file mode 100644 index 8e2ac1be..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos.msg.v1.rs +++ /dev/null @@ -1,2 +0,0 @@ -// @generated -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs deleted file mode 100644 index e400b37a..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos.upgrade.v1beta1.rs +++ /dev/null @@ -1,75 +0,0 @@ -// @generated -/// Plan specifies information about a planned upgrade and when it should occur. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Plan { - /// Sets the name for the upgrade. This name will be used by the upgraded - /// version of the software to apply any special "on-upgrade" commands during - /// the first BeginBlock method after the upgrade is applied. It is also used - /// to detect whether a software version can handle a given upgrade. If no - /// upgrade handler with this name has been set in the software, it will be - /// assumed that the software is out-of-date when the upgrade Time or Height is - /// reached and the software will exit. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - /// has been removed from the SDK. - /// If this field is not empty, an error will be thrown. - #[deprecated] - #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, - /// The height at which the upgrade must be performed. - #[prost(int64, tag = "3")] - pub height: i64, - /// Any application specific upgrade info to be included on-chain - /// such as a git commit that validators could automatically upgrade to - #[prost(string, tag = "4")] - pub info: ::prost::alloc::string::String, - /// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - /// moved to the IBC module in the sub module 02-client. - /// If this field is not empty, an error will be thrown. - #[deprecated] - #[prost(message, optional, tag = "5")] - pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, -} -/// SoftwareUpgradeProposal is a gov Content type for initiating a software -/// upgrade. -/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -/// proposals, see MsgSoftwareUpgrade. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SoftwareUpgradeProposal { - /// title of the proposal - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// plan of the proposal - #[prost(message, optional, tag = "3")] - pub plan: ::core::option::Option, -} -/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -/// upgrade. -/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov -/// proposals, see MsgCancelUpgrade. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CancelSoftwareUpgradeProposal { - /// title of the proposal - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, -} -/// ModuleVersion specifies a module and its consensus version. -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModuleVersion { - /// name of the app module - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// consensus version of the app module - #[prost(uint64, tag = "2")] - pub version: u64, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs b/packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs deleted file mode 100644 index a74f2b1e..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/cosmos_proto.rs +++ /dev/null @@ -1,64 +0,0 @@ -// @generated -/// InterfaceDescriptor describes an interface type to be used with -/// accepts_interface and implements_interface and declared by declare_interface. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterfaceDescriptor { - /// name is the name of the interface. It should be a short-name (without - /// a period) such that the fully qualified name of the interface will be - /// package.name, ex. for the package a.b and interface named C, the - /// fully-qualified name will be a.b.C. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// description is a human-readable description of the interface and its - /// purpose. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, -} -/// ScalarDescriptor describes an scalar type to be used with -/// the scalar field option and declared by declare_scalar. -/// Scalars extend simple protobuf built-in types with additional -/// syntax and semantics, for instance to represent big integers. -/// Scalars should ideally define an encoding such that there is only one -/// valid syntactical representation for a given semantic meaning, -/// i.e. the encoding should be deterministic. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ScalarDescriptor { - /// name is the name of the scalar. It should be a short-name (without - /// a period) such that the fully qualified name of the scalar will be - /// package.name, ex. for the package a.b and scalar named C, the - /// fully-qualified name will be a.b.C. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// description is a human-readable description of the scalar and its - /// encoding format. For instance a big integer or decimal scalar should - /// specify precisely the expected encoding format. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// field_type is the type of field with which this scalar can be used. - /// Scalars can be used with one and only one type of field so that - /// encoding standards and simple and clear. Currently only string and - /// bytes fields are supported for scalars. - #[prost(enumeration = "ScalarType", repeated, tag = "3")] - pub field_type: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ScalarType { - Unspecified = 0, - String = 1, - Bytes = 2, -} -impl ScalarType { - /// 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 { - ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", - ScalarType::String => "SCALAR_TYPE_STRING", - ScalarType::Bytes => "SCALAR_TYPE_BYTES", - } - } -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs deleted file mode 100644 index 13bad6fc..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.rs +++ /dev/null @@ -1,124 +0,0 @@ -// @generated -/// DenomTrace contains the base denomination for ICS20 fungible tokens and the -/// source tracing information path. -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -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, -} -/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -/// method -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -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 -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -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 -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -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. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressRequest { - /// unique port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// unique channel identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressResponse { - /// the escrow account address - #[prost(string, tag = "1")] - pub escrow_address: ::prost::alloc::string::String, -} -/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalEscrowForDenomRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalEscrowForDenomResponse { - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, -} -include!("ibc.applications.transfer.v1.tonic.rs"); -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs deleted file mode 100644 index b29aa84e..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/ibc.applications.transfer.v1.tonic.rs +++ /dev/null @@ -1,222 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn denom_traces( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomTraces", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomTraces", - )); - self.inner.unary(req, path, codec).await - } - pub async fn denom_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomTrace", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomTrace", - )); - self.inner.unary(req, path, codec).await - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "Params", - )); - self.inner.unary(req, path, codec).await - } - pub async fn denom_hash( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomHash", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomHash", - )); - self.inner.unary(req, path, codec).await - } - pub async fn escrow_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/EscrowAddress", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "EscrowAddress", - )); - self.inner.unary(req, path, codec).await - } - pub async fn total_escrow_for_denom( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "TotalEscrowForDenom", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs deleted file mode 100644 index 825d1a9f..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/ibc.core.channel.v1.rs +++ /dev/null @@ -1,207 +0,0 @@ -// @generated -/// 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. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Channel { - /// current state of the channel end - #[prost(enumeration = "State", tag = "1")] - pub state: i32, - /// whether the channel is ordered or unordered - #[prost(enumeration = "Order", tag = "2")] - 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. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedChannel { - /// current state of the channel end - #[prost(enumeration = "State", tag = "1")] - pub state: i32, - /// whether the channel is ordered or unordered - #[prost(enumeration = "Order", tag = "2")] - 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")] - pub port_id: ::prost::alloc::string::String, - /// channel identifier - #[prost(string, tag = "7")] - pub channel_id: ::prost::alloc::string::String, -} -/// Counterparty defines a channel end counterparty -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Counterparty { - /// port on the counterparty chain which owns the other end of the channel. - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel end on the counterparty chain - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// Packet defines a type that carries data across different chains through IBC -#[derive(Clone, PartialEq, ::prost::Message)] -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")] - 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")] - 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")] - 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. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketState { - /// channel port identifier. - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier. - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence. - #[prost(uint64, tag = "3")] - pub sequence: u64, - /// embedded data that represents packet state. - #[prost(bytes = "vec", tag = "4")] - 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 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketId { - /// channel port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - 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: -/// -#[derive(Clone, PartialEq, ::prost::Message)] -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 { - /// response contains either a result or an error and must be non-empty - #[derive(Clone, PartialEq, ::prost::Oneof)] - 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)] -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", - } - } -} -/// Order defines if a channel is ORDERED or UNORDERED -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -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", - } - } -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs b/packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs deleted file mode 100644 index cade23bd..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/ibc.core.client.v1.rs +++ /dev/null @@ -1,102 +0,0 @@ -// @generated -/// IdentifiedClientState defines a client state with an additional client -/// identifier field. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedClientState { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// client state - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, -} -/// ConsensusStateWithHeight defines a consensus state with an additional height -/// field. -#[derive(Clone, PartialEq, ::prost::Message)] -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<::prost_types::Any>, -} -/// ClientConsensusStates defines all the stored consensus states for a given -/// client. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientConsensusStates { - /// client identifier - #[prost(string, tag = "1")] - 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). -#[derive(Clone, PartialEq, ::prost::Message)] -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")] - 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")] - pub substitute_client_id: ::prost::alloc::string::String, -} -/// UpgradeProposal is a gov Content type for initiating an IBC breaking -/// upgrade. -#[derive(Clone, PartialEq, ::prost::Message)] -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<::prost_types::Any>, -} -/// 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 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Height { - /// the revision that the client is currently on - #[prost(uint64, tag = "1")] - pub revision_number: u64, - /// the height within the given revision - #[prost(uint64, tag = "2")] - pub revision_height: u64, -} -/// Params defines the set of IBC light client parameters. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// allowed_clients defines the list of allowed client state types which can be created - /// and interacted with. If a client type is removed from the allowed clients list, usage - /// of this client will be disabled until it is added again to the list. - #[prost(string, repeated, tag = "1")] - pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs deleted file mode 100644 index 65d38314..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.contractmanager.tonic.rs +++ /dev/null @@ -1,277 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.contractmanager.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.contractmanager.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn address_failure( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.contractmanager.Query/AddressFailure", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.contractmanager.Query", - "AddressFailure", - )); - self.inner.unary(req, path, codec).await - } - pub async fn address_failures( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.contractmanager.Query/AddressFailures", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.contractmanager.Query", - "AddressFailures", - )); - self.inner.unary(req, path, codec).await - } - pub async fn failures( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.contractmanager.Query/Failures"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.contractmanager.Query", "Failures")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.contractmanager.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.contractmanager.Msg", - "UpdateParams", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs deleted file mode 100644 index a2195d03..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.cron.tonic.rs +++ /dev/null @@ -1,246 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.cron.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn schedule( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Schedule"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.cron.Query", "Schedule")); - self.inner.unary(req, path, codec).await - } - pub async fn schedules( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.cron.Query/Schedules"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.cron.Query", "Schedules")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.cron.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.cron.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs deleted file mode 100644 index e68c625f..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.dex.tonic.rs +++ /dev/null @@ -1,668 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn deposit( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/Deposit"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "Deposit")); - self.inner.unary(req, path, codec).await - } - pub async fn withdrawal( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/Withdrawal"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "Withdrawal")); - self.inner.unary(req, path, codec).await - } - pub async fn place_limit_order( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/PlaceLimitOrder"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "PlaceLimitOrder")); - self.inner.unary(req, path, codec).await - } - pub async fn withdraw_filled_limit_order( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Msg/WithdrawFilledLimitOrder"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Msg", - "WithdrawFilledLimitOrder", - )); - self.inner.unary(req, path, codec).await - } - pub async fn cancel_limit_order( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/CancelLimitOrder"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "CancelLimitOrder")); - self.inner.unary(req, path, codec).await - } - pub async fn multi_hop_swap( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/MultiHopSwap"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "MultiHopSwap")); - self.inner.unary(req, path, codec).await - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn limit_order_tranche_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheUser"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "LimitOrderTrancheUser", - )); - self.inner.unary(req, path, codec).await - } - pub async fn limit_order_tranche_user_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheUserAll"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "LimitOrderTrancheUserAll", - )); - self.inner.unary(req, path, codec).await - } - pub async fn limit_order_tranche_user_all_by_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "LimitOrderTrancheUserAllByAddress", - )); - self.inner.unary(req, path, codec).await - } - pub async fn limit_order_tranche( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTranche"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "LimitOrderTranche")); - self.inner.unary(req, path, codec).await - } - pub async fn limit_order_tranche_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Query/LimitOrderTrancheAll"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "LimitOrderTrancheAll")); - self.inner.unary(req, path, codec).await - } - pub async fn user_deposits_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/UserDepositsAll"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "UserDepositsAll")); - self.inner.unary(req, path, codec).await - } - pub async fn tick_liquidity_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/TickLiquidityAll"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "TickLiquidityAll")); - self.inner.unary(req, path, codec).await - } - pub async fn inactive_limit_order_tranche( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.dex.Query/InactiveLimitOrderTranche", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "InactiveLimitOrderTranche", - )); - self.inner.unary(req, path, codec).await - } - pub async fn inactive_limit_order_tranche_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.dex.Query/InactiveLimitOrderTrancheAll", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "InactiveLimitOrderTrancheAll", - )); - self.inner.unary(req, path, codec).await - } - pub async fn pool_reserves_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolReservesAll"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "PoolReservesAll")); - self.inner.unary(req, path, codec).await - } - pub async fn pool_reserves( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolReserves"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "PoolReserves")); - self.inner.unary(req, path, codec).await - } - pub async fn estimate_multi_hop_swap( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Query/EstimateMultiHopSwap"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "EstimateMultiHopSwap")); - self.inner.unary(req, path, codec).await - } - pub async fn estimate_place_limit_order( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.dex.Query/EstimatePlaceLimitOrder"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.dex.Query", - "EstimatePlaceLimitOrder", - )); - self.inner.unary(req, path, codec).await - } - pub async fn pool( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/Pool"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "Pool")); - self.inner.unary(req, path, codec).await - } - pub async fn pool_by_id( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolByID"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "PoolByID")); - self.inner.unary(req, path, codec).await - } - pub async fn pool_metadata( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolMetadata"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "PoolMetadata")); - self.inner.unary(req, path, codec).await - } - pub async fn pool_metadata_all( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.dex.Query/PoolMetadataAll"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.dex.Query", "PoolMetadataAll")); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs deleted file mode 100644 index 7d4e2ac5..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.feeburner.tonic.rs +++ /dev/null @@ -1,238 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /** Parameters queries the parameters of the module. - */ - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.feeburner.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.feeburner.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /** TotalBurnedNeutronsAmount queries total amount of burned neutron fees. - */ - pub async fn total_burned_neutrons_amount( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.feeburner.Query/TotalBurnedNeutronsAmount", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.feeburner.Query", - "TotalBurnedNeutronsAmount", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.feeburner.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.feeburner.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs deleted file mode 100644 index b5bf3b13..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.feerefunder.tonic.rs +++ /dev/null @@ -1,228 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.feerefunder.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.feerefunder.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn fee_info( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.feerefunder.Query/FeeInfo"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.feerefunder.Query", "FeeInfo")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.feerefunder.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.feerefunder.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs deleted file mode 100644 index 40591789..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchainqueries.tonic.rs +++ /dev/null @@ -1,400 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn register_interchain_query( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Msg/RegisterInterchainQuery", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Msg", - "RegisterInterchainQuery", - )); - self.inner.unary(req, path, codec).await - } - pub async fn submit_query_result( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Msg/SubmitQueryResult", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Msg", - "SubmitQueryResult", - )); - self.inner.unary(req, path, codec).await - } - pub async fn remove_interchain_query( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Msg/RemoveInterchainQuery", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Msg", - "RemoveInterchainQuery", - )); - self.inner.unary(req, path, codec).await - } - pub async fn update_interchain_query( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Msg/UpdateInterchainQuery", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Msg", - "UpdateInterchainQuery", - )); - self.inner.unary(req, path, codec).await - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.interchainqueries.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Msg", - "UpdateParams", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.interchainqueries.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.interchainqueries.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn registered_queries( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Query/RegisteredQueries", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Query", - "RegisteredQueries", - )); - self.inner.unary(req, path, codec).await - } - pub async fn registered_query( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Query/RegisteredQuery", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Query", - "RegisteredQuery", - )); - self.inner.unary(req, path, codec).await - } - pub async fn query_result( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Query/QueryResult", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Query", - "QueryResult", - )); - self.inner.unary(req, path, codec).await - } - pub async fn last_remote_height( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchainqueries.Query/LastRemoteHeight", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchainqueries.Query", - "LastRemoteHeight", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs deleted file mode 100644 index 58f62857..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.tonic.rs +++ /dev/null @@ -1,131 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.interchaintxs.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.interchaintxs.Query", "Params")); - self.inner.unary(req, path, codec).await - } - pub async fn interchain_account_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchaintxs.Query/InterchainAccountAddress", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchaintxs.Query", - "InterchainAccountAddress", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs deleted file mode 100644 index 1ee1b6f7..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.interchaintxs.v1.tonic.rs +++ /dev/null @@ -1,150 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn register_interchain_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/neutron.interchaintxs.v1.Msg/RegisterInterchainAccount", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchaintxs.v1.Msg", - "RegisterInterchainAccount", - )); - self.inner.unary(req, path, codec).await - } - pub async fn submit_tx( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.interchaintxs.v1.Msg/SubmitTx"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.interchaintxs.v1.Msg", "SubmitTx")); - self.inner.unary(req, path, codec).await - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/neutron.interchaintxs.v1.Msg/UpdateParams"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "neutron.interchaintxs.v1.Msg", - "UpdateParams", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs deleted file mode 100644 index 3216be2c..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/neutron.transfer.tonic.rs +++ /dev/null @@ -1,296 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /** DenomTrace queries a denomination trace information. - */ - pub async fn denom_trace( - &mut self, - request: impl tonic::IntoRequest< - super::super::super::ibc::applications::transfer::v1::QueryDenomTraceRequest, - >, - ) -> std::result::Result< - tonic::Response< - super::super::super::ibc::applications::transfer::v1::QueryDenomTraceResponse, - >, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomTrace"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.transfer.Query", "DenomTrace")); - self.inner.unary(req, path, codec).await - } - /** DenomTraces queries all denomination traces. - */ - pub async fn denom_traces( - &mut self, - request: impl tonic::IntoRequest< - super::super::super::ibc::applications::transfer::v1::QueryDenomTracesRequest, - >, - ) -> std::result::Result< - tonic::Response< - super::super::super::ibc::applications::transfer::v1::QueryDenomTracesResponse, - >, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomTraces"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.transfer.Query", "DenomTraces")); - self.inner.unary(req, path, codec).await - } - /** Params queries all parameters of the ibc-transfer module. - */ - pub async fn params( - &mut self, - request: impl tonic::IntoRequest< - super::super::super::ibc::applications::transfer::v1::QueryParamsRequest, - >, - ) -> std::result::Result< - tonic::Response< - super::super::super::ibc::applications::transfer::v1::QueryParamsResponse, - >, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.transfer.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /** DenomHash queries a denomination hash information. - */ - pub async fn denom_hash( - &mut self, - request: impl tonic::IntoRequest< - super::super::super::ibc::applications::transfer::v1::QueryDenomHashRequest, - >, - ) -> std::result::Result< - tonic::Response< - super::super::super::ibc::applications::transfer::v1::QueryDenomHashResponse, - >, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Query/DenomHash"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.transfer.Query", "DenomHash")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn transfer( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/neutron.transfer.Msg/Transfer"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("neutron.transfer.Msg", "Transfer")); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs b/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs deleted file mode 100644 index 6f325f2a..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.tonic.rs +++ /dev/null @@ -1,435 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Query", - "Params", - )); - self.inner.unary(req, path, codec).await - } - pub async fn denom_authority_metadata( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Query", - "DenomAuthorityMetadata", - )); - self.inner.unary(req, path, codec).await - } - pub async fn denoms_from_creator( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Query", - "DenomsFromCreator", - )); - self.inner.unary(req, path, codec).await - } - pub async fn before_send_hook_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Query/BeforeSendHookAddress", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Query", - "BeforeSendHookAddress", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn create_denom( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "CreateDenom", - )); - self.inner.unary(req, path, codec).await - } - pub async fn mint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Mint"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Mint")); - self.inner.unary(req, path, codec).await - } - pub async fn burn( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Burn"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Burn")); - self.inner.unary(req, path, codec).await - } - pub async fn change_admin( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "ChangeAdmin", - )); - self.inner.unary(req, path, codec).await - } - pub async fn set_denom_metadata( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "SetDenomMetadata", - )); - self.inner.unary(req, path, codec).await - } - pub async fn set_before_send_hook( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/SetBeforeSendHook", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "SetBeforeSendHook", - )); - self.inner.unary(req, path, codec).await - } - pub async fn force_transfer( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "ForceTransfer", - )); - self.inner.unary(req, path, codec).await - } - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "osmosis.tokenfactory.v1beta1.Msg", - "UpdateParams", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs similarity index 94% rename from packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs index 680b1efa..e14b7d35 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/osmosis.tokenfactory.v1beta1.rs +++ b/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs @@ -15,8 +15,7 @@ pub struct Params { /// denom. The fee is drawn from the MsgCreateDenom's sender account, and /// transferred to the community pool. #[prost(message, repeated, tag = "1")] - pub denom_creation_fee: - ::prost::alloc::vec::Vec, + pub denom_creation_fee: ::prost::alloc::vec::Vec, /// DenomCreationGasConsume defines the gas cost for creating a new denom. /// This is intended as a spam deterrence mechanism. /// @@ -131,7 +130,7 @@ pub struct MsgMint { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub amount: ::core::option::Option, + pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub mint_to_address: ::prost::alloc::string::String, } @@ -144,7 +143,7 @@ pub struct MsgBurn { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub amount: ::core::option::Option, + pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub burn_from_address: ::prost::alloc::string::String, } @@ -187,7 +186,7 @@ pub struct MsgSetDenomMetadata { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub metadata: ::core::option::Option, + pub metadata: ::core::option::Option, } /// MsgSetDenomMetadataResponse defines the response structure for an executed /// MsgSetDenomMetadata message. @@ -198,7 +197,7 @@ pub struct MsgForceTransfer { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub amount: ::core::option::Option, + pub amount: ::core::option::Option, #[prost(string, tag = "3")] pub transfer_from_address: ::prost::alloc::string::String, #[prost(string, tag = "4")] @@ -226,5 +225,4 @@ pub struct MsgUpdateParams { /// Since: 0.47 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} -include!("osmosis.tokenfactory.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) From 7c02c63af15eb31c38f42c03d9329800f8090aae Mon Sep 17 00:00:00 2001 From: Neutron Node User Date: Thu, 23 Nov 2023 14:21:52 +0000 Subject: [PATCH 33/77] fix issues across deps versions for generated proto files --- Cargo.toml | 3 ++- packages/neutron-sdk/Cargo.toml | 1 + .../src/proto_types/neutron.interchainqueries.rs | 10 +++++----- .../neutron-sdk/src/proto_types/neutron.transfer.rs | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 123baaa9..8b330d83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,11 @@ serde-json-wasm = "1.0.0" cw-storage-plus = "1.1.0" cosmwasm-schema = { version = "1.4.0", default-features = false } base64 = "0.21.4" -prost = "0.12.1" +prost = "0.12.3" prost-types = "0.12.1" cosmos-sdk-proto = { version = "0.20.0", default-features = false } bech32 = "0.9.1" thiserror = "1.0.49" protobuf = { version = "3.3.0" } hex = "0.4.3" +tendermint-proto = "0.34" diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index a4f5f676..ae673016 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -20,6 +20,7 @@ protobuf = { workspace = true } cosmwasm-schema = { workspace = true } prost = { workspace = true } prost-types = { workspace = true } +tendermint-proto = { workspace = true } [dev-dependencies] base64 = { workspace = true } diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs b/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs index 47f66463..1d09fed9 100644 --- a/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs @@ -44,7 +44,7 @@ pub struct RegisteredQuery { /// The remote chain last block height when the query result was updated. #[prost(message, optional, tag = "9")] pub last_submitted_result_remote_height: - ::core::option::Option, + ::core::option::Option, /// Amount of coins deposited for the query. #[prost(message, repeated, tag = "10")] pub deposit: ::prost::alloc::vec::Vec, @@ -140,7 +140,7 @@ pub struct StorageValue { /// is the Merkle Proof which proves existence of key-value pair in IAVL /// storage #[prost(message, optional, tag = "4")] - pub proof: ::core::option::Option, + pub proof: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Block { @@ -158,15 +158,15 @@ pub struct Block { #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxValue { #[prost(message, optional, tag = "1")] - pub response: ::core::option::Option, + pub response: ::core::option::Option, /// is the Merkle Proof which proves existence of response in block with height /// next_block_header.Height #[prost(message, optional, tag = "2")] - pub delivery_proof: ::core::option::Option, + pub delivery_proof: ::core::option::Option, /// is the Merkle Proof which proves existence of data in block with height /// header.Height #[prost(message, optional, tag = "3")] - pub inclusion_proof: ::core::option::Option, + pub inclusion_proof: ::core::option::Option, /// is body of the transaction #[prost(bytes = "vec", tag = "4")] pub data: ::prost::alloc::vec::Vec, diff --git a/packages/neutron-sdk/src/proto_types/neutron.transfer.rs b/packages/neutron-sdk/src/proto_types/neutron.transfer.rs index 33f4fece..c01c5ab4 100644 --- a/packages/neutron-sdk/src/proto_types/neutron.transfer.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.transfer.rs @@ -19,7 +19,7 @@ pub struct MsgTransfer { /// 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, + 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")] From d4b0d8a6fac1dee0f6c34ecb23e77ac888f40f5b Mon Sep 17 00:00:00 2001 From: Neutron Node User Date: Thu, 23 Nov 2023 14:23:54 +0000 Subject: [PATCH 34/77] add stragate queries to dex module (wip) --- packages/neutron-sdk/src/lib.rs | 1 + packages/neutron-sdk/src/stargate/mod.rs | 1 + packages/neutron-sdk/src/stargate/query.rs | 49 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 packages/neutron-sdk/src/stargate/mod.rs create mode 100644 packages/neutron-sdk/src/stargate/query.rs diff --git a/packages/neutron-sdk/src/lib.rs b/packages/neutron-sdk/src/lib.rs index 6cdff2c2..c4a0d106 100644 --- a/packages/neutron-sdk/src/lib.rs +++ b/packages/neutron-sdk/src/lib.rs @@ -4,6 +4,7 @@ pub mod interchain_queries; pub mod interchain_txs; pub mod proto_types; pub mod query; +pub mod stargate; pub mod sudo; pub use errors::error::{NeutronError, NeutronResult}; diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs new file mode 100644 index 00000000..67350db2 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -0,0 +1 @@ +pub mod query; diff --git a/packages/neutron-sdk/src/stargate/query.rs b/packages/neutron-sdk/src/stargate/query.rs new file mode 100644 index 00000000..1542c367 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/query.rs @@ -0,0 +1,49 @@ +use crate::proto_types::neutron::dex::{QueryParamsRequest, QueryParamsResponse}; +use cosmwasm_std::{ + Binary, ContractResult, Deps, Empty, QueryRequest, StdError, StdResult, SystemResult, +}; +use prost::bytes::Bytes; +use prost::Message; +use serde_json_wasm::to_vec; + +const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; +const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; +const LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTranche"; +const USER_DEPOSITS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserDepositsAll"; +const USER_LIMIT_ORDERS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserLimitOrdersAll"; +const INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = + "/neutron.dex.Query/InactiveLimitOrderTranche"; +const POOL_RESERVES_QUERY_PATH: &str = "/neutron.dex.Query/PoolReserves"; +const ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH: &str = "/neutron.dex.Query/EstimateMultiHopSwap"; +const ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH: &str = "/neutron.dex.Query/EstimatePlaceLimitOrder"; + +// FOR MSG: cosmwasm_std::CosmosMsg::Stargate { type_url: (), value: () } + +pub fn get_neutron_dex_params(deps: Deps) -> StdResult { + let payload = QueryParamsRequest {}; + let resp = make_stargate_query(deps, PARAMS_QUERY_PATH.to_string(), payload.encode_to_vec())?; + QueryParamsResponse::decode(Bytes::copy_from_slice(&resp)) + .map_err(|e| StdError::generic_err(e.to_string())) +} + +fn make_stargate_query(deps: Deps, path: String, encoded_query_data: Vec) -> StdResult { + let raw = to_vec::>(&QueryRequest::Stargate { + path, + data: encoded_query_data.into(), + }) + .map_err(|serialize_err| { + StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + })?; + match deps.querier.raw_query(&raw) { + SystemResult::Err(system_err) => Err(StdError::generic_err(format!( + "Querier system error: {}", + system_err + ))), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( + "Querier contract error: {}", + contract_err + ))), + // response(value) is base64 encoded bytes + SystemResult::Ok(ContractResult::Ok(value)) => Ok(value), + } +} From ab967613d2d13233bb698d64934c8a60ea30c6ba Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 24 Nov 2023 13:37:15 +0300 Subject: [PATCH 35/77] add all query and msg stargate helpers for the dex module --- packages/neutron-sdk/src/stargate/aux.rs | 47 ++++++++++ packages/neutron-sdk/src/stargate/mod.rs | 20 ++++- packages/neutron-sdk/src/stargate/msg_dex.rs | 37 ++++++++ packages/neutron-sdk/src/stargate/query.rs | 49 ----------- .../neutron-sdk/src/stargate/query_dex.rs | 86 +++++++++++++++++++ 5 files changed, 189 insertions(+), 50 deletions(-) create mode 100644 packages/neutron-sdk/src/stargate/aux.rs create mode 100644 packages/neutron-sdk/src/stargate/msg_dex.rs delete mode 100644 packages/neutron-sdk/src/stargate/query.rs create mode 100644 packages/neutron-sdk/src/stargate/query_dex.rs diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs new file mode 100644 index 00000000..215fcde0 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -0,0 +1,47 @@ +use cosmwasm_std::{ + ContractResult, CosmosMsg, Empty, QuerierWrapper, QueryRequest, StdError, StdResult, + SystemResult, +}; +use prost::bytes::Bytes; +use serde_json_wasm::to_vec; + +pub(crate) fn make_stargate_query( + querier: QuerierWrapper, + req: Req, + path: &str, +) -> StdResult +where + Req: prost::Message, + Res: prost::Message + Default, +{ + let raw = to_vec::>(&QueryRequest::Stargate { + path: path.to_string(), + data: req.encode_to_vec().into(), + }) + .map_err(|serialize_err| { + StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + })?; + + match querier.raw_query(&raw) { + SystemResult::Err(system_err) => Err(StdError::generic_err(format!( + "Querier system error: {}", + system_err + ))), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( + "Querier contract error: {}", + contract_err + ))), + SystemResult::Ok(ContractResult::Ok(value)) => Res::decode(Bytes::copy_from_slice(&value)) + .map_err(|e| StdError::generic_err(e.to_string())), + } +} + +pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg +where + Req: prost::Message, +{ + cosmwasm_std::CosmosMsg::Stargate { + type_url: path.to_string(), + value: req.encode_to_vec().into(), + } +} diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 67350db2..0f536980 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -1 +1,19 @@ -pub mod query; +pub(crate) mod aux; +pub(crate) mod msg_dex; +pub(crate) mod query_dex; + +pub mod query { + pub mod neutron { + pub mod dex { + pub use crate::stargate::query_dex::*; + } + } +} + +pub mod msg { + pub mod neutron { + pub mod dex { + pub use crate::stargate::msg_dex::*; + } + } +} diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs new file mode 100644 index 00000000..40b53650 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -0,0 +1,37 @@ +use crate::proto_types::neutron::dex::{ + MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, + MsgWithdrawFilledLimitOrder, MsgWithdrawal, +}; +use crate::stargate::aux::create_stargate_msg; +use cosmwasm_std::CosmosMsg; + +const DEPOSIT_MSG_PATH: &str = "/neutron.dex.Msg/Deposit"; +const WITHDRAWAL_MSG_PATH: &str = "/neutron.dex.Msg/Withdrawal"; +const PLACE_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/PlaceLimitOrder"; +const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/WithdrawFilledLimitOrder"; +const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/CancelLimitOrder"; +const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.Msg/MultiHopSwap"; + +pub fn msg_deposit(req: MsgDeposit) -> CosmosMsg { + create_stargate_msg(req, DEPOSIT_MSG_PATH) +} + +pub fn msg_withdrawal(req: MsgWithdrawal) -> CosmosMsg { + create_stargate_msg(req, WITHDRAWAL_MSG_PATH) +} + +pub fn msg_place_limit_order(req: MsgPlaceLimitOrder) -> CosmosMsg { + create_stargate_msg(req, PLACE_LIMIT_ORDER_MSG_PATH) +} + +pub fn msg_withdraw_filled_limit_order(req: MsgWithdrawFilledLimitOrder) -> CosmosMsg { + create_stargate_msg(req, WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH) +} + +pub fn msg_cancel_limit_order(req: MsgCancelLimitOrder) -> CosmosMsg { + create_stargate_msg(req, CANCEL_LIMIT_ORDER_MSG_PATH) +} + +pub fn msg_multi_hop_swap(req: MsgMultiHopSwap) -> CosmosMsg { + create_stargate_msg(req, MULTI_HOP_SWAP_MSG_PATH) +} diff --git a/packages/neutron-sdk/src/stargate/query.rs b/packages/neutron-sdk/src/stargate/query.rs deleted file mode 100644 index 1542c367..00000000 --- a/packages/neutron-sdk/src/stargate/query.rs +++ /dev/null @@ -1,49 +0,0 @@ -use crate::proto_types::neutron::dex::{QueryParamsRequest, QueryParamsResponse}; -use cosmwasm_std::{ - Binary, ContractResult, Deps, Empty, QueryRequest, StdError, StdResult, SystemResult, -}; -use prost::bytes::Bytes; -use prost::Message; -use serde_json_wasm::to_vec; - -const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; -const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; -const LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTranche"; -const USER_DEPOSITS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserDepositsAll"; -const USER_LIMIT_ORDERS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserLimitOrdersAll"; -const INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = - "/neutron.dex.Query/InactiveLimitOrderTranche"; -const POOL_RESERVES_QUERY_PATH: &str = "/neutron.dex.Query/PoolReserves"; -const ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH: &str = "/neutron.dex.Query/EstimateMultiHopSwap"; -const ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH: &str = "/neutron.dex.Query/EstimatePlaceLimitOrder"; - -// FOR MSG: cosmwasm_std::CosmosMsg::Stargate { type_url: (), value: () } - -pub fn get_neutron_dex_params(deps: Deps) -> StdResult { - let payload = QueryParamsRequest {}; - let resp = make_stargate_query(deps, PARAMS_QUERY_PATH.to_string(), payload.encode_to_vec())?; - QueryParamsResponse::decode(Bytes::copy_from_slice(&resp)) - .map_err(|e| StdError::generic_err(e.to_string())) -} - -fn make_stargate_query(deps: Deps, path: String, encoded_query_data: Vec) -> StdResult { - let raw = to_vec::>(&QueryRequest::Stargate { - path, - data: encoded_query_data.into(), - }) - .map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; - match deps.querier.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err - ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( - "Querier contract error: {}", - contract_err - ))), - // response(value) is base64 encoded bytes - SystemResult::Ok(ContractResult::Ok(value)) => Ok(value), - } -} diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs new file mode 100644 index 00000000..7bba1f63 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -0,0 +1,86 @@ +use crate::proto_types::neutron::dex::{ + QueryAllUserDepositsRequest, QueryAllUserDepositsResponse, QueryAllUserLimitOrdersRequest, + QueryAllUserLimitOrdersResponse, QueryEstimateMultiHopSwapRequest, + QueryEstimateMultiHopSwapResponse, QueryEstimatePlaceLimitOrderRequest, + QueryEstimatePlaceLimitOrderResponse, QueryGetInactiveLimitOrderTrancheRequest, + QueryGetInactiveLimitOrderTrancheResponse, QueryGetLimitOrderTrancheRequest, + QueryGetLimitOrderTrancheResponse, QueryGetLimitOrderTrancheUserRequest, + QueryGetLimitOrderTrancheUserResponse, QueryGetPoolReservesRequest, + QueryGetPoolReservesResponse, QueryParamsRequest, QueryParamsResponse, +}; +use crate::stargate::aux::make_stargate_query; +use cosmwasm_std::{QuerierWrapper, StdResult}; + +const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; +const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; +const LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTranche"; +const USER_DEPOSITS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserDepositsAll"; +const USER_LIMIT_ORDERS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserLimitOrdersAll"; +const INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = + "/neutron.dex.Query/InactiveLimitOrderTranche"; +const POOL_RESERVES_QUERY_PATH: &str = "/neutron.dex.Query/PoolReserves"; +const ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH: &str = "/neutron.dex.Query/EstimateMultiHopSwap"; +const ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH: &str = "/neutron.dex.Query/EstimatePlaceLimitOrder"; + +pub fn get_params( + querier: QuerierWrapper, + req: QueryParamsRequest, +) -> StdResult { + make_stargate_query(querier, req, PARAMS_QUERY_PATH) +} + +pub fn get_limit_order_tranche_user( + querier: QuerierWrapper, + req: QueryGetLimitOrderTrancheUserRequest, +) -> StdResult { + make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_USER_QUERY_PATH) +} + +pub fn get_limit_order_tranche( + querier: QuerierWrapper, + req: QueryGetLimitOrderTrancheRequest, +) -> StdResult { + make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_QUERY_PATH) +} + +pub fn get_user_deposits_all( + querier: QuerierWrapper, + req: QueryAllUserDepositsRequest, +) -> StdResult { + make_stargate_query(querier, req, USER_DEPOSITS_ALL_QUERY_PATH) +} + +pub fn get_user_limit_orders_all( + querier: QuerierWrapper, + req: QueryAllUserLimitOrdersRequest, +) -> StdResult { + make_stargate_query(querier, req, USER_LIMIT_ORDERS_ALL_QUERY_PATH) +} + +pub fn get_inactive_limit_order_tranche( + querier: QuerierWrapper, + req: QueryGetInactiveLimitOrderTrancheRequest, +) -> StdResult { + make_stargate_query(querier, req, INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH) +} + +pub fn get_pool_reserves( + querier: QuerierWrapper, + req: QueryGetPoolReservesRequest, +) -> StdResult { + make_stargate_query(querier, req, POOL_RESERVES_QUERY_PATH) +} + +pub fn get_estimate_multi_hop_swap( + querier: QuerierWrapper, + req: QueryEstimateMultiHopSwapRequest, +) -> StdResult { + make_stargate_query(querier, req, ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH) +} + +pub fn get_estimate_place_limit_order( + querier: QuerierWrapper, + req: QueryEstimatePlaceLimitOrderRequest, +) -> StdResult { + make_stargate_query(querier, req, ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH) +} From 6247e6c6ef5daa1919a1c3ba55bf742cbcef345b Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 28 Nov 2023 12:44:54 +0300 Subject: [PATCH 36/77] refactor dex msg helpers to accept list of adapted params instead of proto messages --- packages/neutron-sdk/src/stargate/msg_dex.rs | 138 +++++++++++++++++-- 1 file changed, 123 insertions(+), 15 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index 40b53650..84acdddf 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -1,9 +1,12 @@ use crate::proto_types::neutron::dex::{ - MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, - MsgWithdrawFilledLimitOrder, MsgWithdrawal, + DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, + MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, }; use crate::stargate::aux::create_stargate_msg; -use cosmwasm_std::CosmosMsg; +use cosmwasm_std::{CosmosMsg, MessageInfo, Timestamp}; +use prost_types::Timestamp as TimestampGen; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; const DEPOSIT_MSG_PATH: &str = "/neutron.dex.Msg/Deposit"; const WITHDRAWAL_MSG_PATH: &str = "/neutron.dex.Msg/Withdrawal"; @@ -12,26 +15,131 @@ const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/WithdrawFil const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/CancelLimitOrder"; const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.Msg/MultiHopSwap"; -pub fn msg_deposit(req: MsgDeposit) -> CosmosMsg { - create_stargate_msg(req, DEPOSIT_MSG_PATH) +pub fn msg_deposit( + info: MessageInfo, + receiver: String, + token_a: String, + token_b: String, + amounts_a: Vec, + amounts_b: Vec, + tick_indexes_a_to_b: Vec, + fees: Vec, + deposit_options: Vec, +) -> CosmosMsg { + let msg = MsgDeposit { + creator: info.sender.to_string(), + receiver, + token_a, + token_b, + amounts_a, + amounts_b, + tick_indexes_a_to_b, + fees, + options: deposit_options.into_iter().map(|o| o.into()).collect(), + }; + create_stargate_msg(msg, DEPOSIT_MSG_PATH) } -pub fn msg_withdrawal(req: MsgWithdrawal) -> CosmosMsg { - create_stargate_msg(req, WITHDRAWAL_MSG_PATH) +pub fn msg_withdrawal( + info: MessageInfo, + receiver: String, + token_a: String, + token_b: String, + shares_to_remove: Vec, + tick_indexes_a_to_b: Vec, + fees: Vec, +) -> CosmosMsg { + let msg = MsgWithdrawal { + creator: info.sender.to_string(), + receiver, + token_a, + token_b, + shares_to_remove, + tick_indexes_a_to_b, + fees, + }; + create_stargate_msg(msg, WITHDRAWAL_MSG_PATH) } -pub fn msg_place_limit_order(req: MsgPlaceLimitOrder) -> CosmosMsg { - create_stargate_msg(req, PLACE_LIMIT_ORDER_MSG_PATH) +pub fn msg_place_limit_order( + info: MessageInfo, + receiver: String, + token_in: String, + token_out: String, + tick_index_in_to_out: i64, + amount_in: String, + order_type: i32, + expiration_time: Option, + max_amount_out: Option, +) -> CosmosMsg { + let msg = MsgPlaceLimitOrder { + creator: info.sender.to_string(), + receiver, + token_in, + token_out, + tick_index_in_to_out, + amount_in, + order_type, + expiration_time: expiration_time.map(|e| convert_timestamp(e)), + max_amount_out: max_amount_out.unwrap_or_default(), + }; + create_stargate_msg(msg, PLACE_LIMIT_ORDER_MSG_PATH) } -pub fn msg_withdraw_filled_limit_order(req: MsgWithdrawFilledLimitOrder) -> CosmosMsg { - create_stargate_msg(req, WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH) +pub fn msg_withdraw_filled_limit_order(info: MessageInfo, tranche_key: String) -> CosmosMsg { + let msg = MsgWithdrawFilledLimitOrder { + creator: info.sender.to_string(), + tranche_key, + }; + create_stargate_msg(msg, WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH) } -pub fn msg_cancel_limit_order(req: MsgCancelLimitOrder) -> CosmosMsg { - create_stargate_msg(req, CANCEL_LIMIT_ORDER_MSG_PATH) +pub fn msg_cancel_limit_order(info: MessageInfo, tranche_key: String) -> CosmosMsg { + let msg = MsgCancelLimitOrder { + creator: info.sender.to_string(), + tranche_key, + }; + create_stargate_msg(msg, CANCEL_LIMIT_ORDER_MSG_PATH) } -pub fn msg_multi_hop_swap(req: MsgMultiHopSwap) -> CosmosMsg { - create_stargate_msg(req, MULTI_HOP_SWAP_MSG_PATH) +pub fn msg_multi_hop_swap( + info: MessageInfo, + receiver: String, + routes: Vec>, + amount_in: String, + exit_limit_price: String, + pick_best_route: bool, +) -> CosmosMsg { + let msg = MsgMultiHopSwap { + creator: info.sender.to_string(), + receiver, + routes: routes + .into_iter() + .map(|r| MultiHopRoute { hops: r }) + .collect(), + amount_in, + exit_limit_price, + pick_best_route, + }; + create_stargate_msg(msg, MULTI_HOP_SWAP_MSG_PATH) +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct DepositOptions { + pub disable_autoswap: bool, +} + +impl Into for DepositOptions { + fn into(self) -> DepositOptionsGen { + DepositOptionsGen { + disable_autoswap: self.disable_autoswap, + } + } +} + +fn convert_timestamp(timestamp: Timestamp) -> TimestampGen { + TimestampGen { + seconds: i64::try_from(timestamp.seconds()).unwrap(), + nanos: i32::try_from(timestamp.subsec_nanos()).unwrap(), + } } From 9a59bb83088f92c669d4c0aba74ec44f71a398f2 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 28 Nov 2023 13:23:26 +0300 Subject: [PATCH 37/77] refine proto msg encoding --- packages/neutron-sdk/src/stargate/aux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 215fcde0..6f2156d2 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,5 +1,5 @@ use cosmwasm_std::{ - ContractResult, CosmosMsg, Empty, QuerierWrapper, QueryRequest, StdError, StdResult, + Binary, ContractResult, CosmosMsg, Empty, QuerierWrapper, QueryRequest, StdError, StdResult, SystemResult, }; use prost::bytes::Bytes; @@ -42,6 +42,6 @@ where { cosmwasm_std::CosmosMsg::Stargate { type_url: path.to_string(), - value: req.encode_to_vec().into(), + value: Binary::from(req.encode_to_vec()), } } From aa40227da3664305422af43b4726121c8ed9bee9 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 28 Nov 2023 13:23:39 +0300 Subject: [PATCH 38/77] fix proto msg type urls --- packages/neutron-sdk/src/stargate/msg_dex.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index 84acdddf..04c55344 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -8,12 +8,12 @@ use prost_types::Timestamp as TimestampGen; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -const DEPOSIT_MSG_PATH: &str = "/neutron.dex.Msg/Deposit"; -const WITHDRAWAL_MSG_PATH: &str = "/neutron.dex.Msg/Withdrawal"; -const PLACE_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/PlaceLimitOrder"; -const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/WithdrawFilledLimitOrder"; -const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.Msg/CancelLimitOrder"; -const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.Msg/MultiHopSwap"; +const DEPOSIT_MSG_PATH: &str = "/neutron.dex.MsgDeposit"; +const WITHDRAWAL_MSG_PATH: &str = "/neutron.dex.MsgWithdrawal"; +const PLACE_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgPlaceLimitOrder"; +const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgWithdrawFilledLimitOrder"; +const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgCancelLimitOrder"; +const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; pub fn msg_deposit( info: MessageInfo, From f0392fa96867aade3821f69ef5c5dcc8c5569ed6 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 28 Nov 2023 14:06:14 +0300 Subject: [PATCH 39/77] replace info param with sender string in dex helpers --- packages/neutron-sdk/src/stargate/msg_dex.rs | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index 04c55344..e0a96dd5 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -3,7 +3,7 @@ use crate::proto_types::neutron::dex::{ MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, }; use crate::stargate::aux::create_stargate_msg; -use cosmwasm_std::{CosmosMsg, MessageInfo, Timestamp}; +use cosmwasm_std::{CosmosMsg, Timestamp}; use prost_types::Timestamp as TimestampGen; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -16,7 +16,7 @@ const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgCancelLimitOrder"; const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; pub fn msg_deposit( - info: MessageInfo, + sender: String, receiver: String, token_a: String, token_b: String, @@ -27,7 +27,7 @@ pub fn msg_deposit( deposit_options: Vec, ) -> CosmosMsg { let msg = MsgDeposit { - creator: info.sender.to_string(), + creator: sender, receiver, token_a, token_b, @@ -41,7 +41,7 @@ pub fn msg_deposit( } pub fn msg_withdrawal( - info: MessageInfo, + sender: String, receiver: String, token_a: String, token_b: String, @@ -50,7 +50,7 @@ pub fn msg_withdrawal( fees: Vec, ) -> CosmosMsg { let msg = MsgWithdrawal { - creator: info.sender.to_string(), + creator: sender, receiver, token_a, token_b, @@ -62,7 +62,7 @@ pub fn msg_withdrawal( } pub fn msg_place_limit_order( - info: MessageInfo, + sender: String, receiver: String, token_in: String, token_out: String, @@ -73,7 +73,7 @@ pub fn msg_place_limit_order( max_amount_out: Option, ) -> CosmosMsg { let msg = MsgPlaceLimitOrder { - creator: info.sender.to_string(), + creator: sender, receiver, token_in, token_out, @@ -86,24 +86,24 @@ pub fn msg_place_limit_order( create_stargate_msg(msg, PLACE_LIMIT_ORDER_MSG_PATH) } -pub fn msg_withdraw_filled_limit_order(info: MessageInfo, tranche_key: String) -> CosmosMsg { +pub fn msg_withdraw_filled_limit_order(sender: String, tranche_key: String) -> CosmosMsg { let msg = MsgWithdrawFilledLimitOrder { - creator: info.sender.to_string(), + creator: sender, tranche_key, }; create_stargate_msg(msg, WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH) } -pub fn msg_cancel_limit_order(info: MessageInfo, tranche_key: String) -> CosmosMsg { +pub fn msg_cancel_limit_order(sender: String, tranche_key: String) -> CosmosMsg { let msg = MsgCancelLimitOrder { - creator: info.sender.to_string(), + creator: sender, tranche_key, }; create_stargate_msg(msg, CANCEL_LIMIT_ORDER_MSG_PATH) } pub fn msg_multi_hop_swap( - info: MessageInfo, + sender: String, receiver: String, routes: Vec>, amount_in: String, @@ -111,7 +111,7 @@ pub fn msg_multi_hop_swap( pick_best_route: bool, ) -> CosmosMsg { let msg = MsgMultiHopSwap { - creator: info.sender.to_string(), + creator: sender, receiver, routes: routes .into_iter() From 7cdfb670bce031ade6aed102b6bce6c4079558fc Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 28 Nov 2023 16:35:52 +0300 Subject: [PATCH 40/77] refine parameters naming for deposit helper and type for place limit order helper --- packages/neutron-sdk/src/stargate/msg_dex.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index e0a96dd5..7403e956 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -1,6 +1,6 @@ use crate::proto_types::neutron::dex::{ - DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, - MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, + DepositOptions as DepositOptionsGen, LimitOrderType, MsgCancelLimitOrder, MsgDeposit, + MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, }; use crate::stargate::aux::create_stargate_msg; use cosmwasm_std::{CosmosMsg, Timestamp}; @@ -24,7 +24,7 @@ pub fn msg_deposit( amounts_b: Vec, tick_indexes_a_to_b: Vec, fees: Vec, - deposit_options: Vec, + options: Vec, ) -> CosmosMsg { let msg = MsgDeposit { creator: sender, @@ -35,7 +35,7 @@ pub fn msg_deposit( amounts_b, tick_indexes_a_to_b, fees, - options: deposit_options.into_iter().map(|o| o.into()).collect(), + options: options.into_iter().map(|o| o.into()).collect(), }; create_stargate_msg(msg, DEPOSIT_MSG_PATH) } @@ -68,7 +68,7 @@ pub fn msg_place_limit_order( token_out: String, tick_index_in_to_out: i64, amount_in: String, - order_type: i32, + order_type: LimitOrderType, expiration_time: Option, max_amount_out: Option, ) -> CosmosMsg { @@ -79,7 +79,7 @@ pub fn msg_place_limit_order( token_out, tick_index_in_to_out, amount_in, - order_type, + order_type: i32::from(order_type), expiration_time: expiration_time.map(|e| convert_timestamp(e)), max_amount_out: max_amount_out.unwrap_or_default(), }; From 708778e95e37888b8fc5e211bd5fd6d9729f7796 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Wed, 29 Nov 2023 19:14:54 +0300 Subject: [PATCH 41/77] add helpers for all remaining dex stargate queries --- .../neutron-sdk/src/stargate/query_dex.rs | 94 ++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 7bba1f63..855ad907 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -1,26 +1,45 @@ use crate::proto_types::neutron::dex::{ + QueryAllInactiveLimitOrderTrancheRequest, QueryAllInactiveLimitOrderTrancheResponse, + QueryAllLimitOrderTrancheRequest, QueryAllLimitOrderTrancheResponse, + QueryAllLimitOrderTrancheUserRequest, QueryAllLimitOrderTrancheUserResponse, + QueryAllPoolMetadataRequest, QueryAllPoolMetadataResponse, QueryAllPoolReservesRequest, + QueryAllPoolReservesResponse, QueryAllTickLiquidityRequest, QueryAllTickLiquidityResponse, QueryAllUserDepositsRequest, QueryAllUserDepositsResponse, QueryAllUserLimitOrdersRequest, QueryAllUserLimitOrdersResponse, QueryEstimateMultiHopSwapRequest, QueryEstimateMultiHopSwapResponse, QueryEstimatePlaceLimitOrderRequest, QueryEstimatePlaceLimitOrderResponse, QueryGetInactiveLimitOrderTrancheRequest, QueryGetInactiveLimitOrderTrancheResponse, QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheResponse, QueryGetLimitOrderTrancheUserRequest, - QueryGetLimitOrderTrancheUserResponse, QueryGetPoolReservesRequest, - QueryGetPoolReservesResponse, QueryParamsRequest, QueryParamsResponse, + QueryGetLimitOrderTrancheUserResponse, QueryGetPoolMetadataRequest, + QueryGetPoolMetadataResponse, QueryGetPoolReservesRequest, QueryGetPoolReservesResponse, + QueryParamsRequest, QueryParamsResponse, QueryPoolByIdRequest, QueryPoolRequest, + QueryPoolResponse, }; use crate::stargate::aux::make_stargate_query; use cosmwasm_std::{QuerierWrapper, StdResult}; const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; +const LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUserAll"; +const LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH: &str = + "/neutron.dex.Query/LimitOrderTrancheUserAllByAddress"; const LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTranche"; +const LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheAll"; const USER_DEPOSITS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserDepositsAll"; +const TICK_LIQUIDITY_ALL_QUERY_PATH: &str = "/neutron.dex.Query/TickLiquidityAll"; const USER_LIMIT_ORDERS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserLimitOrdersAll"; const INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/InactiveLimitOrderTranche"; +const INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH: &str = + "/neutron.dex.Query/InactiveLimitOrderTrancheAll"; +const POOL_RESERVES_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolReservesAll"; const POOL_RESERVES_QUERY_PATH: &str = "/neutron.dex.Query/PoolReserves"; const ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH: &str = "/neutron.dex.Query/EstimateMultiHopSwap"; const ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH: &str = "/neutron.dex.Query/EstimatePlaceLimitOrder"; +const POOL_QUERY_PATH: &str = "/neutron.dex.Query/Pool"; +const POOL_BY_ID_QUERY_PATH: &str = "/neutron.dex.Query/PoolByID"; +const POOL_METADATA_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadata"; +const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; pub fn get_params( querier: QuerierWrapper, @@ -36,6 +55,24 @@ pub fn get_limit_order_tranche_user( make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_USER_QUERY_PATH) } +pub fn get_limit_order_tranche_user_all( + querier: QuerierWrapper, + req: QueryAllLimitOrderTrancheUserRequest, +) -> StdResult { + make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH) +} + +pub fn get_limit_order_tranche_user_all_by_address( + querier: QuerierWrapper, + req: QueryAllUserLimitOrdersRequest, +) -> StdResult { + make_stargate_query( + querier, + req, + LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH, + ) +} + pub fn get_limit_order_tranche( querier: QuerierWrapper, req: QueryGetLimitOrderTrancheRequest, @@ -43,6 +80,13 @@ pub fn get_limit_order_tranche( make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_QUERY_PATH) } +pub fn get_limit_order_tranche_all( + querier: QuerierWrapper, + req: QueryAllLimitOrderTrancheRequest, +) -> StdResult { + make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH) +} + pub fn get_user_deposits_all( querier: QuerierWrapper, req: QueryAllUserDepositsRequest, @@ -50,6 +94,13 @@ pub fn get_user_deposits_all( make_stargate_query(querier, req, USER_DEPOSITS_ALL_QUERY_PATH) } +pub fn get_tick_liquidity_all( + querier: QuerierWrapper, + req: QueryAllTickLiquidityRequest, +) -> StdResult { + make_stargate_query(querier, req, TICK_LIQUIDITY_ALL_QUERY_PATH) +} + pub fn get_user_limit_orders_all( querier: QuerierWrapper, req: QueryAllUserLimitOrdersRequest, @@ -64,6 +115,20 @@ pub fn get_inactive_limit_order_tranche( make_stargate_query(querier, req, INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH) } +pub fn get_inactive_limit_order_tranche_all( + querier: QuerierWrapper, + req: QueryAllInactiveLimitOrderTrancheRequest, +) -> StdResult { + make_stargate_query(querier, req, INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH) +} + +pub fn get_pool_reserves_all( + querier: QuerierWrapper, + req: QueryAllPoolReservesRequest, +) -> StdResult { + make_stargate_query(querier, req, POOL_RESERVES_ALL_QUERY_PATH) +} + pub fn get_pool_reserves( querier: QuerierWrapper, req: QueryGetPoolReservesRequest, @@ -84,3 +149,28 @@ pub fn get_estimate_place_limit_order( ) -> StdResult { make_stargate_query(querier, req, ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH) } + +pub fn get_pool(querier: QuerierWrapper, req: QueryPoolRequest) -> StdResult { + make_stargate_query(querier, req, POOL_QUERY_PATH) +} + +pub fn get_pool_by_id( + querier: QuerierWrapper, + req: QueryPoolByIdRequest, +) -> StdResult { + make_stargate_query(querier, req, POOL_BY_ID_QUERY_PATH) +} + +pub fn get_pool_metadata( + querier: QuerierWrapper, + req: QueryGetPoolMetadataRequest, +) -> StdResult { + make_stargate_query(querier, req, POOL_METADATA_QUERY_PATH) +} + +pub fn get_pool_metadata_all( + querier: QuerierWrapper, + req: QueryAllPoolMetadataRequest, +) -> StdResult { + make_stargate_query(querier, req, POOL_METADATA_ALL_QUERY_PATH) +} From 1bd0701e3f7a86b9bad52f440d1116b7747fe758 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 08:18:42 +0300 Subject: [PATCH 42/77] move convert_timestamp to aux --- packages/neutron-sdk/src/stargate/aux.rs | 10 +++++++++- packages/neutron-sdk/src/stargate/msg_dex.rs | 10 +--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 6f2156d2..bf61c5e1 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,8 +1,9 @@ use cosmwasm_std::{ Binary, ContractResult, CosmosMsg, Empty, QuerierWrapper, QueryRequest, StdError, StdResult, - SystemResult, + SystemResult, Timestamp, }; use prost::bytes::Bytes; +use prost_types::Timestamp as TimestampGen; use serde_json_wasm::to_vec; pub(crate) fn make_stargate_query( @@ -45,3 +46,10 @@ where value: Binary::from(req.encode_to_vec()), } } + +pub(crate) fn convert_timestamp(timestamp: Timestamp) -> TimestampGen { + TimestampGen { + seconds: i64::try_from(timestamp.seconds()).unwrap(), + nanos: i32::try_from(timestamp.subsec_nanos()).unwrap(), + } +} diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index 7403e956..ca475595 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -2,9 +2,8 @@ use crate::proto_types::neutron::dex::{ DepositOptions as DepositOptionsGen, LimitOrderType, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, }; -use crate::stargate::aux::create_stargate_msg; +use crate::stargate::aux::{convert_timestamp, create_stargate_msg}; use cosmwasm_std::{CosmosMsg, Timestamp}; -use prost_types::Timestamp as TimestampGen; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -136,10 +135,3 @@ impl Into for DepositOptions { } } } - -fn convert_timestamp(timestamp: Timestamp) -> TimestampGen { - TimestampGen { - seconds: i64::try_from(timestamp.seconds()).unwrap(), - nanos: i32::try_from(timestamp.subsec_nanos()).unwrap(), - } -} From 3b4bb3f34bf4dcadeb6ef7f6009bf670b813a97e Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 08:19:53 +0300 Subject: [PATCH 43/77] refactor dex query helpers to accept list of adapted params instead of proto messages --- .../neutron-sdk/src/stargate/query_dex.rs | 281 +++++++++++++----- 1 file changed, 214 insertions(+), 67 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 855ad907..bf6ea973 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -1,22 +1,23 @@ use crate::proto_types::neutron::dex::{ - QueryAllInactiveLimitOrderTrancheRequest, QueryAllInactiveLimitOrderTrancheResponse, - QueryAllLimitOrderTrancheRequest, QueryAllLimitOrderTrancheResponse, - QueryAllLimitOrderTrancheUserRequest, QueryAllLimitOrderTrancheUserResponse, - QueryAllPoolMetadataRequest, QueryAllPoolMetadataResponse, QueryAllPoolReservesRequest, - QueryAllPoolReservesResponse, QueryAllTickLiquidityRequest, QueryAllTickLiquidityResponse, - QueryAllUserDepositsRequest, QueryAllUserDepositsResponse, QueryAllUserLimitOrdersRequest, - QueryAllUserLimitOrdersResponse, QueryEstimateMultiHopSwapRequest, - QueryEstimateMultiHopSwapResponse, QueryEstimatePlaceLimitOrderRequest, - QueryEstimatePlaceLimitOrderResponse, QueryGetInactiveLimitOrderTrancheRequest, - QueryGetInactiveLimitOrderTrancheResponse, QueryGetLimitOrderTrancheRequest, - QueryGetLimitOrderTrancheResponse, QueryGetLimitOrderTrancheUserRequest, - QueryGetLimitOrderTrancheUserResponse, QueryGetPoolMetadataRequest, - QueryGetPoolMetadataResponse, QueryGetPoolReservesRequest, QueryGetPoolReservesResponse, - QueryParamsRequest, QueryParamsResponse, QueryPoolByIdRequest, QueryPoolRequest, - QueryPoolResponse, + LimitOrderType, MultiHopRoute, QueryAllInactiveLimitOrderTrancheRequest, + QueryAllInactiveLimitOrderTrancheResponse, QueryAllLimitOrderTrancheRequest, + QueryAllLimitOrderTrancheResponse, QueryAllLimitOrderTrancheUserRequest, + QueryAllLimitOrderTrancheUserResponse, QueryAllPoolMetadataRequest, + QueryAllPoolMetadataResponse, QueryAllPoolReservesRequest, QueryAllPoolReservesResponse, + QueryAllTickLiquidityRequest, QueryAllTickLiquidityResponse, QueryAllUserDepositsRequest, + QueryAllUserDepositsResponse, QueryAllUserLimitOrdersRequest, QueryAllUserLimitOrdersResponse, + QueryEstimateMultiHopSwapRequest, QueryEstimateMultiHopSwapResponse, + QueryEstimatePlaceLimitOrderRequest, QueryEstimatePlaceLimitOrderResponse, + QueryGetInactiveLimitOrderTrancheRequest, QueryGetInactiveLimitOrderTrancheResponse, + QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheResponse, + QueryGetLimitOrderTrancheUserRequest, QueryGetLimitOrderTrancheUserResponse, + QueryGetPoolMetadataRequest, QueryGetPoolMetadataResponse, QueryGetPoolReservesRequest, + QueryGetPoolReservesResponse, QueryParamsRequest, QueryParamsResponse, QueryPoolByIdRequest, + QueryPoolRequest, QueryPoolResponse, }; -use crate::stargate::aux::make_stargate_query; -use cosmwasm_std::{QuerierWrapper, StdResult}; +use crate::stargate::aux::{convert_timestamp, make_stargate_query}; +use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest; +use cosmwasm_std::{QuerierWrapper, StdResult, Timestamp}; const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; @@ -27,7 +28,6 @@ const LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTranc const LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheAll"; const USER_DEPOSITS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserDepositsAll"; const TICK_LIQUIDITY_ALL_QUERY_PATH: &str = "/neutron.dex.Query/TickLiquidityAll"; -const USER_LIMIT_ORDERS_ALL_QUERY_PATH: &str = "/neutron.dex.Query/UserLimitOrdersAll"; const INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH: &str = "/neutron.dex.Query/InactiveLimitOrderTranche"; const INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH: &str = @@ -41,136 +41,283 @@ const POOL_BY_ID_QUERY_PATH: &str = "/neutron.dex.Query/PoolByID"; const POOL_METADATA_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadata"; const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; -pub fn get_params( - querier: QuerierWrapper, - req: QueryParamsRequest, -) -> StdResult { - make_stargate_query(querier, req, PARAMS_QUERY_PATH) +pub fn get_params(querier: QuerierWrapper) -> StdResult { + make_stargate_query(querier, QueryParamsRequest {}, PARAMS_QUERY_PATH) } pub fn get_limit_order_tranche_user( querier: QuerierWrapper, - req: QueryGetLimitOrderTrancheUserRequest, + address: String, + tranche_key: String, ) -> StdResult { - make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_USER_QUERY_PATH) + make_stargate_query( + querier, + QueryGetLimitOrderTrancheUserRequest { + address, + tranche_key, + }, + LIMIT_ORDER_TRANCHE_USER_QUERY_PATH, + ) } pub fn get_limit_order_tranche_user_all( querier: QuerierWrapper, - req: QueryAllLimitOrderTrancheUserRequest, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllLimitOrderTrancheUserRequest { pagination }, + LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH, + ) } pub fn get_limit_order_tranche_user_all_by_address( querier: QuerierWrapper, - req: QueryAllUserLimitOrdersRequest, + address: String, + pagination: Option, ) -> StdResult { make_stargate_query( querier, - req, + QueryAllUserLimitOrdersRequest { + address, + pagination, + }, LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH, ) } pub fn get_limit_order_tranche( querier: QuerierWrapper, - req: QueryGetLimitOrderTrancheRequest, + pair_id: String, + tick_index: i64, + token_in: String, + tranche_key: String, ) -> StdResult { - make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_QUERY_PATH) + make_stargate_query( + querier, + QueryGetLimitOrderTrancheRequest { + pair_id, + tick_index, + token_in, + tranche_key, + }, + LIMIT_ORDER_TRANCHE_QUERY_PATH, + ) } pub fn get_limit_order_tranche_all( querier: QuerierWrapper, - req: QueryAllLimitOrderTrancheRequest, + pair_id: String, + token_in: String, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllLimitOrderTrancheRequest { + pair_id, + token_in, + pagination, + }, + LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, + ) } pub fn get_user_deposits_all( querier: QuerierWrapper, - req: QueryAllUserDepositsRequest, + address: String, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, USER_DEPOSITS_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllUserDepositsRequest { + address, + pagination, + }, + USER_DEPOSITS_ALL_QUERY_PATH, + ) } pub fn get_tick_liquidity_all( querier: QuerierWrapper, - req: QueryAllTickLiquidityRequest, + pair_id: String, + token_in: String, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, TICK_LIQUIDITY_ALL_QUERY_PATH) -} - -pub fn get_user_limit_orders_all( - querier: QuerierWrapper, - req: QueryAllUserLimitOrdersRequest, -) -> StdResult { - make_stargate_query(querier, req, USER_LIMIT_ORDERS_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllTickLiquidityRequest { + pair_id, + token_in, + pagination, + }, + TICK_LIQUIDITY_ALL_QUERY_PATH, + ) } pub fn get_inactive_limit_order_tranche( querier: QuerierWrapper, - req: QueryGetInactiveLimitOrderTrancheRequest, + pair_id: String, + token_in: String, + tick_index: i64, + tranche_key: String, ) -> StdResult { - make_stargate_query(querier, req, INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH) + make_stargate_query( + querier, + QueryGetInactiveLimitOrderTrancheRequest { + pair_id, + token_in, + tick_index, + tranche_key, + }, + INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH, + ) } pub fn get_inactive_limit_order_tranche_all( querier: QuerierWrapper, - req: QueryAllInactiveLimitOrderTrancheRequest, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllInactiveLimitOrderTrancheRequest { pagination }, + INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, + ) } pub fn get_pool_reserves_all( querier: QuerierWrapper, - req: QueryAllPoolReservesRequest, + pair_id: String, + token_in: String, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, POOL_RESERVES_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllPoolReservesRequest { + pair_id, + token_in, + pagination, + }, + POOL_RESERVES_ALL_QUERY_PATH, + ) } pub fn get_pool_reserves( querier: QuerierWrapper, - req: QueryGetPoolReservesRequest, + pair_id: String, + token_in: String, + tick_index: i64, + fee: u64, ) -> StdResult { - make_stargate_query(querier, req, POOL_RESERVES_QUERY_PATH) + make_stargate_query( + querier, + QueryGetPoolReservesRequest { + pair_id, + token_in, + tick_index, + fee, + }, + POOL_RESERVES_QUERY_PATH, + ) } pub fn get_estimate_multi_hop_swap( querier: QuerierWrapper, - req: QueryEstimateMultiHopSwapRequest, + creator: String, + receiver: String, + routes: Vec>, + amount_in: String, + exit_limit_price: String, + pick_best_route: bool, ) -> StdResult { - make_stargate_query(querier, req, ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH) + make_stargate_query( + querier, + QueryEstimateMultiHopSwapRequest { + creator, + receiver, + routes: routes + .into_iter() + .map(|r| MultiHopRoute { hops: r }) + .collect(), + amount_in, + exit_limit_price, + pick_best_route, + }, + ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH, + ) } pub fn get_estimate_place_limit_order( querier: QuerierWrapper, - req: QueryEstimatePlaceLimitOrderRequest, + creator: String, + receiver: String, + token_in: String, + token_out: String, + tick_index_in_to_out: i64, + amount_in: String, + order_type: LimitOrderType, + expiration_time: Option, + max_amount_out: Option, ) -> StdResult { - make_stargate_query(querier, req, ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH) -} - -pub fn get_pool(querier: QuerierWrapper, req: QueryPoolRequest) -> StdResult { - make_stargate_query(querier, req, POOL_QUERY_PATH) + make_stargate_query( + querier, + QueryEstimatePlaceLimitOrderRequest { + creator, + receiver, + token_in, + token_out, + tick_index_in_to_out, + amount_in, + order_type: i32::from(order_type), + expiration_time: expiration_time.map(|e| convert_timestamp(e)), + max_amount_out: max_amount_out.unwrap_or_default(), + }, + ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH, + ) } -pub fn get_pool_by_id( +pub fn get_pool( querier: QuerierWrapper, - req: QueryPoolByIdRequest, + pair_id: String, + tick_index: i64, + fee: u64, ) -> StdResult { - make_stargate_query(querier, req, POOL_BY_ID_QUERY_PATH) + make_stargate_query( + querier, + QueryPoolRequest { + pair_id, + tick_index, + fee, + }, + POOL_QUERY_PATH, + ) +} + +pub fn get_pool_by_id(querier: QuerierWrapper, pool_id: u64) -> StdResult { + make_stargate_query( + querier, + QueryPoolByIdRequest { pool_id }, + POOL_BY_ID_QUERY_PATH, + ) } pub fn get_pool_metadata( querier: QuerierWrapper, - req: QueryGetPoolMetadataRequest, + id: u64, ) -> StdResult { - make_stargate_query(querier, req, POOL_METADATA_QUERY_PATH) + make_stargate_query( + querier, + QueryGetPoolMetadataRequest { id }, + POOL_METADATA_QUERY_PATH, + ) } pub fn get_pool_metadata_all( querier: QuerierWrapper, - req: QueryAllPoolMetadataRequest, + pagination: Option, ) -> StdResult { - make_stargate_query(querier, req, POOL_METADATA_ALL_QUERY_PATH) + make_stargate_query( + querier, + QueryAllPoolMetadataRequest { pagination }, + POOL_METADATA_ALL_QUERY_PATH, + ) } From c31d833b4cb870e4e9c51973ba7e3731b936075b Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 08:26:19 +0300 Subject: [PATCH 44/77] fix linter concerns --- packages/neutron-sdk/src/stargate/msg_dex.rs | 10 ++++++---- packages/neutron-sdk/src/stargate/query_dex.rs | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index ca475595..a38c70e6 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -14,6 +14,7 @@ const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgWithdrawFill const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgCancelLimitOrder"; const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; +#[allow(clippy::too_many_arguments)] pub fn msg_deposit( sender: String, receiver: String, @@ -60,6 +61,7 @@ pub fn msg_withdrawal( create_stargate_msg(msg, WITHDRAWAL_MSG_PATH) } +#[allow(clippy::too_many_arguments)] pub fn msg_place_limit_order( sender: String, receiver: String, @@ -79,7 +81,7 @@ pub fn msg_place_limit_order( tick_index_in_to_out, amount_in, order_type: i32::from(order_type), - expiration_time: expiration_time.map(|e| convert_timestamp(e)), + expiration_time: expiration_time.map(convert_timestamp), max_amount_out: max_amount_out.unwrap_or_default(), }; create_stargate_msg(msg, PLACE_LIMIT_ORDER_MSG_PATH) @@ -128,10 +130,10 @@ pub struct DepositOptions { pub disable_autoswap: bool, } -impl Into for DepositOptions { - fn into(self) -> DepositOptionsGen { +impl From for DepositOptionsGen { + fn from(o: DepositOptions) -> DepositOptionsGen { DepositOptionsGen { - disable_autoswap: self.disable_autoswap, + disable_autoswap: o.disable_autoswap, } } } diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index bf6ea973..8add9537 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -246,6 +246,7 @@ pub fn get_estimate_multi_hop_swap( ) } +#[allow(clippy::too_many_arguments)] pub fn get_estimate_place_limit_order( querier: QuerierWrapper, creator: String, @@ -268,7 +269,7 @@ pub fn get_estimate_place_limit_order( tick_index_in_to_out, amount_in, order_type: i32::from(order_type), - expiration_time: expiration_time.map(|e| convert_timestamp(e)), + expiration_time: expiration_time.map(convert_timestamp), max_amount_out: max_amount_out.unwrap_or_default(), }, ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH, From f8f423adc4acd15b4087d3b4c2d762b77e75623e Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 09:47:46 +0300 Subject: [PATCH 45/77] decode query result as base64 --- packages/neutron-sdk/src/stargate/aux.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index bf61c5e1..cd97ea98 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -32,8 +32,10 @@ where "Querier contract error: {}", contract_err ))), - SystemResult::Ok(ContractResult::Ok(value)) => Res::decode(Bytes::copy_from_slice(&value)) - .map_err(|e| StdError::generic_err(e.to_string())), + SystemResult::Ok(ContractResult::Ok(value)) => Res::decode(Bytes::copy_from_slice( + Binary::from_base64(&value.to_base64())?.as_slice(), + )) + .map_err(|e| StdError::generic_err(e.to_string())), } } From c7c664a9cb85f9e13034fb6fbb76ea326108d718 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 10:39:34 +0300 Subject: [PATCH 46/77] debug: add stargate query resp debug logging --- packages/neutron-sdk/src/stargate/aux.rs | 33 +++++--- .../neutron-sdk/src/stargate/query_dex.rs | 77 +++++++++---------- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index cd97ea98..08b5be9b 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,16 +1,12 @@ use cosmwasm_std::{ - Binary, ContractResult, CosmosMsg, Empty, QuerierWrapper, QueryRequest, StdError, StdResult, + Binary, ContractResult, CosmosMsg, Deps, Empty, QueryRequest, StdError, StdResult, SystemResult, Timestamp, }; use prost::bytes::Bytes; use prost_types::Timestamp as TimestampGen; use serde_json_wasm::to_vec; -pub(crate) fn make_stargate_query( - querier: QuerierWrapper, - req: Req, - path: &str, -) -> StdResult +pub(crate) fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult where Req: prost::Message, Res: prost::Message + Default, @@ -23,7 +19,7 @@ where StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) })?; - match querier.raw_query(&raw) { + match deps.querier.raw_query(&raw) { SystemResult::Err(system_err) => Err(StdError::generic_err(format!( "Querier system error: {}", system_err @@ -32,10 +28,25 @@ where "Querier contract error: {}", contract_err ))), - SystemResult::Ok(ContractResult::Ok(value)) => Res::decode(Bytes::copy_from_slice( - Binary::from_base64(&value.to_base64())?.as_slice(), - )) - .map_err(|e| StdError::generic_err(e.to_string())), + SystemResult::Ok(ContractResult::Ok(value)) => { + deps.api.debug( + format!( + "WASMDEBUG: stargate query raw resp: {:?}", + value.to_string() + ) + .as_str(), + ); + deps.api.debug( + format!( + "WASMDEBUG: stargate query to_base_64 resp: {:?}", + value.to_base64() + ) + .as_str(), + ); + + Res::decode(Bytes::copy_from_slice(&value)) + .map_err(|e| StdError::generic_err(e.to_string())) + } } } diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 8add9537..24df9062 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -17,7 +17,7 @@ use crate::proto_types::neutron::dex::{ }; use crate::stargate::aux::{convert_timestamp, make_stargate_query}; use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest; -use cosmwasm_std::{QuerierWrapper, StdResult, Timestamp}; +use cosmwasm_std::{Deps, QuerierWrapper, StdResult, Timestamp}; const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; @@ -41,17 +41,17 @@ const POOL_BY_ID_QUERY_PATH: &str = "/neutron.dex.Query/PoolByID"; const POOL_METADATA_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadata"; const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; -pub fn get_params(querier: QuerierWrapper) -> StdResult { - make_stargate_query(querier, QueryParamsRequest {}, PARAMS_QUERY_PATH) +pub fn get_params(deps: Deps) -> StdResult { + make_stargate_query(deps, QueryParamsRequest {}, PARAMS_QUERY_PATH) } pub fn get_limit_order_tranche_user( - querier: QuerierWrapper, + deps: Deps, address: String, tranche_key: String, ) -> StdResult { make_stargate_query( - querier, + deps, QueryGetLimitOrderTrancheUserRequest { address, tranche_key, @@ -61,23 +61,23 @@ pub fn get_limit_order_tranche_user( } pub fn get_limit_order_tranche_user_all( - querier: QuerierWrapper, + deps: Deps, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllLimitOrderTrancheUserRequest { pagination }, LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH, ) } pub fn get_limit_order_tranche_user_all_by_address( - querier: QuerierWrapper, + deps: Deps, address: String, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllUserLimitOrdersRequest { address, pagination, @@ -87,14 +87,14 @@ pub fn get_limit_order_tranche_user_all_by_address( } pub fn get_limit_order_tranche( - querier: QuerierWrapper, + deps: Deps, pair_id: String, tick_index: i64, token_in: String, tranche_key: String, ) -> StdResult { make_stargate_query( - querier, + deps, QueryGetLimitOrderTrancheRequest { pair_id, tick_index, @@ -106,13 +106,13 @@ pub fn get_limit_order_tranche( } pub fn get_limit_order_tranche_all( - querier: QuerierWrapper, + deps: Deps, pair_id: String, token_in: String, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllLimitOrderTrancheRequest { pair_id, token_in, @@ -123,12 +123,12 @@ pub fn get_limit_order_tranche_all( } pub fn get_user_deposits_all( - querier: QuerierWrapper, + deps: Deps, address: String, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllUserDepositsRequest { address, pagination, @@ -138,13 +138,13 @@ pub fn get_user_deposits_all( } pub fn get_tick_liquidity_all( - querier: QuerierWrapper, + deps: Deps, pair_id: String, token_in: String, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllTickLiquidityRequest { pair_id, token_in, @@ -155,14 +155,14 @@ pub fn get_tick_liquidity_all( } pub fn get_inactive_limit_order_tranche( - querier: QuerierWrapper, + deps: Deps, pair_id: String, token_in: String, tick_index: i64, tranche_key: String, ) -> StdResult { make_stargate_query( - querier, + deps, QueryGetInactiveLimitOrderTrancheRequest { pair_id, token_in, @@ -174,24 +174,24 @@ pub fn get_inactive_limit_order_tranche( } pub fn get_inactive_limit_order_tranche_all( - querier: QuerierWrapper, + deps: Deps, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllInactiveLimitOrderTrancheRequest { pagination }, INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, ) } pub fn get_pool_reserves_all( - querier: QuerierWrapper, + deps: Deps, pair_id: String, token_in: String, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllPoolReservesRequest { pair_id, token_in, @@ -202,14 +202,14 @@ pub fn get_pool_reserves_all( } pub fn get_pool_reserves( - querier: QuerierWrapper, + deps: Deps, pair_id: String, token_in: String, tick_index: i64, fee: u64, ) -> StdResult { make_stargate_query( - querier, + deps, QueryGetPoolReservesRequest { pair_id, token_in, @@ -221,7 +221,7 @@ pub fn get_pool_reserves( } pub fn get_estimate_multi_hop_swap( - querier: QuerierWrapper, + deps: Deps, creator: String, receiver: String, routes: Vec>, @@ -230,7 +230,7 @@ pub fn get_estimate_multi_hop_swap( pick_best_route: bool, ) -> StdResult { make_stargate_query( - querier, + deps, QueryEstimateMultiHopSwapRequest { creator, receiver, @@ -248,7 +248,7 @@ pub fn get_estimate_multi_hop_swap( #[allow(clippy::too_many_arguments)] pub fn get_estimate_place_limit_order( - querier: QuerierWrapper, + deps: Deps, creator: String, receiver: String, token_in: String, @@ -260,7 +260,7 @@ pub fn get_estimate_place_limit_order( max_amount_out: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryEstimatePlaceLimitOrderRequest { creator, receiver, @@ -277,13 +277,13 @@ pub fn get_estimate_place_limit_order( } pub fn get_pool( - querier: QuerierWrapper, + deps: Deps, pair_id: String, tick_index: i64, fee: u64, ) -> StdResult { make_stargate_query( - querier, + deps, QueryPoolRequest { pair_id, tick_index, @@ -293,31 +293,28 @@ pub fn get_pool( ) } -pub fn get_pool_by_id(querier: QuerierWrapper, pool_id: u64) -> StdResult { +pub fn get_pool_by_id(deps: Deps, pool_id: u64) -> StdResult { make_stargate_query( - querier, + deps, QueryPoolByIdRequest { pool_id }, POOL_BY_ID_QUERY_PATH, ) } -pub fn get_pool_metadata( - querier: QuerierWrapper, - id: u64, -) -> StdResult { +pub fn get_pool_metadata(deps: Deps, id: u64) -> StdResult { make_stargate_query( - querier, + deps, QueryGetPoolMetadataRequest { id }, POOL_METADATA_QUERY_PATH, ) } pub fn get_pool_metadata_all( - querier: QuerierWrapper, + deps: Deps, pagination: Option, ) -> StdResult { make_stargate_query( - querier, + deps, QueryAllPoolMetadataRequest { pagination }, POOL_METADATA_ALL_QUERY_PATH, ) From c3c1313ff9af8012d1adc1a2f765036793680e0e Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Thu, 30 Nov 2023 14:10:03 +0300 Subject: [PATCH 47/77] polish mod.rs of proto_types --- packages/neutron-sdk/src/proto_types/mod.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index eca6f66c..0f4a01c7 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -2,12 +2,14 @@ pub mod neutron { pub mod dex { include!("neutron.dex.rs"); } + pub mod interchaintxs { include!("neutron.interchaintxs.rs"); pub mod v1 { include!("neutron.interchaintxs.v1.rs"); } } + pub mod feeburner { include!("neutron.feeburner.rs"); } @@ -29,12 +31,9 @@ pub mod neutron { pub mod contractmanager { include!("neutron.contractmanager.rs"); - } -} - -pub mod contractmanager { - pub mod v1 { - include!("neutron.contractmanager.v1.rs"); + pub mod v1 { + include!("neutron.contractmanager.v1.rs"); + } } } From eb0b0752e2738a82fc8b528030a98a2a90995a49 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 15:34:44 +0300 Subject: [PATCH 48/77] move proto_types to stargate package --- packages/neutron-sdk/src/lib.rs | 1 - packages/neutron-sdk/src/stargate/mod.rs | 1 + .../{ => stargate}/proto_types/NEUTRON_COMMIT | 0 .../src/{ => stargate}/proto_types/mod.rs | 0 .../proto_types/neutron.contractmanager.rs | 0 .../proto_types/neutron.contractmanager.v1.rs | 0 .../proto_types/neutron.cron.rs | 0 .../{ => stargate}/proto_types/neutron.dex.rs | 0 .../proto_types/neutron.feeburner.rs | 0 .../proto_types/neutron.feerefunder.rs | 0 .../proto_types/neutron.interchainqueries.rs | 0 .../proto_types/neutron.interchaintxs.rs | 0 .../proto_types/neutron.interchaintxs.v1.rs | 0 .../proto_types/neutron.transfer.rs | 0 .../osmosis.tokenfactory.v1beta1.rs | 0 .../neutron-sdk/src/stargate/types_dex.rs | 619 ++++++++++++++++++ 16 files changed, 620 insertions(+), 1 deletion(-) rename packages/neutron-sdk/src/{ => stargate}/proto_types/NEUTRON_COMMIT (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/mod.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.contractmanager.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.contractmanager.v1.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.cron.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.dex.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.feeburner.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.feerefunder.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.interchainqueries.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.interchaintxs.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.interchaintxs.v1.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/neutron.transfer.rs (100%) rename packages/neutron-sdk/src/{ => stargate}/proto_types/osmosis.tokenfactory.v1beta1.rs (100%) create mode 100644 packages/neutron-sdk/src/stargate/types_dex.rs diff --git a/packages/neutron-sdk/src/lib.rs b/packages/neutron-sdk/src/lib.rs index c4a0d106..a470feeb 100644 --- a/packages/neutron-sdk/src/lib.rs +++ b/packages/neutron-sdk/src/lib.rs @@ -2,7 +2,6 @@ pub mod bindings; mod errors; pub mod interchain_queries; pub mod interchain_txs; -pub mod proto_types; pub mod query; pub mod stargate; pub mod sudo; diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 0f536980..bc1be897 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -1,5 +1,6 @@ pub(crate) mod aux; pub(crate) mod msg_dex; +pub(crate) mod proto_types; pub(crate) mod query_dex; pub mod query { diff --git a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/stargate/proto_types/NEUTRON_COMMIT similarity index 100% rename from packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT rename to packages/neutron-sdk/src/stargate/proto_types/NEUTRON_COMMIT diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/stargate/proto_types/mod.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/mod.rs rename to packages/neutron-sdk/src/stargate/proto_types/mod.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.cron.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.cron.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.cron.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.cron.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.dex.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.dex.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.dex.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.dex.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.feeburner.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.feeburner.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.feeburner.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.feeburner.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.feerefunder.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.feerefunder.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.interchainqueries.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.interchainqueries.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.v1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.v1.rs diff --git a/packages/neutron-sdk/src/proto_types/neutron.transfer.rs b/packages/neutron-sdk/src/stargate/proto_types/neutron.transfer.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/neutron.transfer.rs rename to packages/neutron-sdk/src/stargate/proto_types/neutron.transfer.rs diff --git a/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/stargate/proto_types/osmosis.tokenfactory.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs rename to packages/neutron-sdk/src/stargate/proto_types/osmosis.tokenfactory.v1beta1.rs diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs new file mode 100644 index 00000000..236cef42 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -0,0 +1,619 @@ +use crate::bindings::query::{PageRequest, PageResponse}; +use crate::stargate::aux::convert_timestamp; +use crate::stargate::proto_types::neutron::dex::{ + DepositOptions as DepositOptionsGen, MultiHopRoute, QueryAllInactiveLimitOrderTrancheRequest, + QueryAllLimitOrderTrancheRequest, QueryAllLimitOrderTrancheUserRequest, + QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, QueryAllTickLiquidityRequest, + QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest, QueryEstimateMultiHopSwapRequest, + QueryEstimatePlaceLimitOrderRequest, QueryGetInactiveLimitOrderTrancheRequest, + QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheUserRequest, + QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest, + QueryPoolByIdRequest, QueryPoolRequest, +}; +use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen; +use cosmwasm_std::{Coin, Int128}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use serde_repr::{Deserialize_repr, Serialize_repr}; + +// Params query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct ParamsRequest {} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct ParamsResponse { + pub params: Params, +} + +impl From for QueryParamsRequest { + fn from(_: ParamsRequest) -> QueryParamsRequest { + QueryParamsRequest {} + } +} + +// LimitOrderTrancheUser query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct LimitOrderTrancheUserRequest { + pub address: String, + pub tranche_key: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct LimitOrderTrancheUserResponse { + pub limit_order_tranche_user: Option, +} + +impl From for QueryGetLimitOrderTrancheUserRequest { + fn from(v: LimitOrderTrancheUserRequest) -> QueryGetLimitOrderTrancheUserRequest { + QueryGetLimitOrderTrancheUserRequest { + address: v.address, + tranche_key: v.tranche_key, + } + } +} + +// LimitOrderTrancheUserAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct LimitOrderTrancheUserAllRequest { + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct LimitOrderTrancheUserAllRespose { + pub limit_order_tranche_user: Vec, + pub pagination: Option, +} + +impl From for QueryAllLimitOrderTrancheUserRequest { + fn from(v: LimitOrderTrancheUserAllRequest) -> QueryAllLimitOrderTrancheUserRequest { + QueryAllLimitOrderTrancheUserRequest { + pagination: convert_page_request(v.pagination), + } + } +} + +// LimitOrderTrancheUserAllByAddress query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllUserLimitOrdersRequest { + pub address: String, + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllUserLimitOrdersResponse { + pub limit_orders: Vec, + pub pagination: Option, +} + +impl From for QueryAllUserLimitOrdersRequest { + fn from(v: AllUserLimitOrdersRequest) -> QueryAllUserLimitOrdersRequest { + QueryAllUserLimitOrdersRequest { + address: v.address, + pagination: convert_page_request(v.pagination), + } + } +} + +// LimitOrderTranche query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetLimitOrderTrancheRequest { + pub pair_id: String, + pub tick_index: i64, + pub token_in: String, + pub tranche_key: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetLimitOrderTrancheResponse { + pub limit_order_tranche: Option, +} + +impl From for QueryGetLimitOrderTrancheRequest { + fn from(v: GetLimitOrderTrancheRequest) -> QueryGetLimitOrderTrancheRequest { + QueryGetLimitOrderTrancheRequest { + pair_id: v.pair_id, + tick_index: v.tick_index, + token_in: v.token_in, + tranche_key: v.tranche_key, + } + } +} + +// LimitOrderTrancheAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllLimitOrderTrancheRequest { + pub pair_id: String, + pub token_in: String, + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllLimitOrderTrancheResponse { + pub limit_order_tranche: Vec, + pub pagination: Option, +} + +impl From for QueryAllLimitOrderTrancheRequest { + fn from(v: AllLimitOrderTrancheRequest) -> QueryAllLimitOrderTrancheRequest { + QueryAllLimitOrderTrancheRequest { + pair_id: v.pair_id, + token_in: v.token_in, + pagination: convert_page_request(v.pagination), + } + } +} + +// UserDepositsAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllUserDepositsRequest { + pub address: String, + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllUserDepositsResponse { + pub deposits: Vec, + pub pagination: Option, +} + +impl From for QueryAllUserDepositsRequest { + fn from(v: AllUserDepositsRequest) -> QueryAllUserDepositsRequest { + QueryAllUserDepositsRequest { + address: v.address, + pagination: convert_page_request(v.pagination), + } + } +} + +// TickLiquidityAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllTickLiquidityRequest { + pub pair_id: String, + pub token_in: String, + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllTickLiquidityResponse { + pub tick_liquidity: Vec, + pub pagination: Option, +} + +impl From for QueryAllTickLiquidityRequest { + fn from(v: AllTickLiquidityRequest) -> QueryAllTickLiquidityRequest { + QueryAllTickLiquidityRequest { + pair_id: v.pair_id, + token_in: v.token_in, + pagination: convert_page_request(v.pagination), + } + } +} + +// InactiveLimitOrderTranche query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetInactiveLimitOrderTrancheRequest { + pub pair_id: String, + pub token_in: String, + pub tick_index: i64, + pub tranche_key: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetInactiveLimitOrderTrancheResponse { + pub inactive_limit_order_tranche: LimitOrderTranche, +} + +impl From for QueryGetInactiveLimitOrderTrancheRequest { + fn from(v: GetInactiveLimitOrderTrancheRequest) -> QueryGetInactiveLimitOrderTrancheRequest { + QueryGetInactiveLimitOrderTrancheRequest { + pair_id: v.pair_id, + token_in: v.token_in, + tick_index: v.tick_index, + tranche_key: v.tranche_key, + } + } +} + +// InactiveLimitOrderTrancheAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllInactiveLimitOrderTrancheRequest { + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllInactiveLimitOrderTrancheResponse { + pub inactive_limit_order_tranche: Vec, + pub pagination: Option, +} + +impl From for QueryAllInactiveLimitOrderTrancheRequest { + fn from(v: AllInactiveLimitOrderTrancheRequest) -> QueryAllInactiveLimitOrderTrancheRequest { + QueryAllInactiveLimitOrderTrancheRequest { + pagination: convert_page_request(v.pagination), + } + } +} + +// PoolReservesAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllPoolReservesRequest { + pub pair_id: String, + pub token_in: String, + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllPoolReservesResponse { + pub pool_reserves: Vec, + pub pagination: Option, +} + +impl From for QueryAllPoolReservesRequest { + fn from(v: AllPoolReservesRequest) -> QueryAllPoolReservesRequest { + QueryAllPoolReservesRequest { + pair_id: v.pair_id, + token_in: v.token_in, + pagination: convert_page_request(v.pagination), + } + } +} + +// PoolReserves query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetPoolReservesRequest { + pub pair_id: String, + pub token_in: String, + pub tick_index: i64, + pub fee: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetPoolReservesResponse { + pub pool_reserves: PoolReserves, +} + +impl From for QueryGetPoolReservesRequest { + fn from(v: GetPoolReservesRequest) -> QueryGetPoolReservesRequest { + QueryGetPoolReservesRequest { + pair_id: v.pair_id, + token_in: v.token_in, + tick_index: v.tick_index, + fee: v.fee, + } + } +} + +// EstimateMultiHopSwap query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct EstimateMultiHopSwapRequest { + pub creator: String, + pub receiver: String, + pub routes: Vec>, + pub amount_in: String, + pub exit_limit_price: String, + pub pick_best_route: bool, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct EstimateMultiHopSwapResponse { + pub coin_out: Coin, +} + +impl From for QueryEstimateMultiHopSwapRequest { + fn from(v: EstimateMultiHopSwapRequest) -> QueryEstimateMultiHopSwapRequest { + QueryEstimateMultiHopSwapRequest { + creator: v.creator, + receiver: v.receiver, + routes: v + .routes + .into_iter() + .map(|r| MultiHopRoute { hops: r }) + .collect(), + amount_in: v.amount_in, + exit_limit_price: v.exit_limit_price, + pick_best_route: v.pick_best_route, + } + } +} + +// EstimatePlaceLimitOrder query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct EstimatePlaceLimitOrderRequest { + pub creator: String, + pub receiver: String, + pub token_in: String, + pub token_out: String, + pub tick_index_in_to_out: i64, + pub amount_in: String, + pub order_type: LimitOrderType, + pub expiration_time: Option, + pub max_amount_out: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct EstimatePlaceLimitOrderResponse { + // Total amount of coin used for the limit order + // You can derive makerLimitInCoin using the equation: totalInCoin = swapInCoin + makerLimitInCoin + pub total_in_coin: Coin, + // Total amount of the token in that was immediately swapped for swapOutCoin + pub swap_in_coin: Coin, + // Total amount of coin received from the taker portion of the limit order + // This is the amount of coin immediately available in the users account after executing the + // limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + pub swap_out_coin: Coin, +} + +impl From for QueryEstimatePlaceLimitOrderRequest { + fn from(v: EstimatePlaceLimitOrderRequest) -> QueryEstimatePlaceLimitOrderRequest { + QueryEstimatePlaceLimitOrderRequest { + creator: v.creator, + receiver: v.receiver, + token_in: v.token_in, + token_out: v.token_out, + tick_index_in_to_out: v.tick_index_in_to_out, + amount_in: v.amount_in, + order_type: v.order_type as i32, + expiration_time: v.expiration_time.map(convert_timestamp), + max_amount_out: v.max_amount_out.unwrap_or_default(), + } + } +} + +// Pool query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct PoolRequest { + pub pair_id: String, + pub tick_index: i64, + pub fee: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct PoolResponse { + pub pool: Pool, +} + +impl From for QueryPoolRequest { + fn from(v: PoolRequest) -> QueryPoolRequest { + QueryPoolRequest { + pair_id: v.pair_id, + tick_index: v.tick_index, + fee: v.fee, + } + } +} + +// PoolByID query + +pub struct PoolByIdRequest { + pub pool_id: u64, +} + +impl From for QueryPoolByIdRequest { + fn from(v: PoolByIdRequest) -> QueryPoolByIdRequest { + QueryPoolByIdRequest { pool_id: v.pool_id } + } +} + +// PoolMetadata query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetPoolMetadataRequest { + pub id: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct GetPoolMetadataResponse { + pub pool_metadata: PoolMetadata, +} + +impl From for QueryGetPoolMetadataRequest { + fn from(v: GetPoolMetadataRequest) -> QueryGetPoolMetadataRequest { + QueryGetPoolMetadataRequest { id: v.id } + } +} + +// PoolMetadataAll query + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllPoolMetadataRequest { + pub pagination: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct AllPoolMetadataResponse { + pub pool_metadata: Vec, + pub pagination: Option, +} + +impl From for QueryAllPoolMetadataRequest { + fn from(v: AllPoolMetadataRequest) -> QueryAllPoolMetadataRequest { + QueryAllPoolMetadataRequest { + pagination: convert_page_request(v.pagination), + } + } +} + +// Common + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct DepositOptions { + pub disable_autoswap: bool, +} + +impl From for DepositOptionsGen { + fn from(o: DepositOptions) -> DepositOptionsGen { + DepositOptionsGen { + disable_autoswap: o.disable_autoswap, + } + } +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct Params { + pub fee_tiers: Vec, +} + +#[derive(Serialize_repr, Deserialize_repr, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[repr(i32)] +pub enum LimitOrderType { + GoodTilCancelled = 0, + FillOrKill = 1, + ImmediateOrCancel = 2, + JustInTime = 3, + GoodTilTime = 4, +} + +impl TryFrom for LimitOrderType { + type Error = String; + + fn try_from(v: i32) -> Result { + match v { + 0 => Ok(LimitOrderType::GoodTilCancelled), + 1 => Ok(LimitOrderType::FillOrKill), + 2 => Ok(LimitOrderType::ImmediateOrCancel), + 3 => Ok(LimitOrderType::JustInTime), + 4 => Ok(LimitOrderType::GoodTilTime), + _ => Err(format!( + "invalid numeric value for LimitOrderType {}: expected 0-4", + v + )), + } + } +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct LimitOrderTrancheUser { + pub trade_pair_id: TradePairID, + pub tick_index_taker_to_maker: i64, + pub tranche_key: String, + pub address: String, + pub shares_owned: Int128, + pub shares_withdrawn: Int128, + pub shares_cancelled: Int128, + pub order_type: LimitOrderType, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct LimitOrderTrancheKey { + pub trade_pair_id: TradePairID, + pub tick_index_taker_to_maker: i64, + pub tranche_key: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct LimitOrderTranche { + pub key: LimitOrderTrancheKey, + pub reserves_maker_denom: Int128, + pub reserves_taker_denom: Int128, + pub total_maker_denom: Int128, + pub total_taker_denom: Int128, + pub expiration_time: Option, + pub price_taker_to_maker: String, // TODO: refactor to PrecDec +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct DepositRecord { + pub pair_id: PairID, + pub shares_owned: Int128, + pub center_tick_index: i64, + pub lower_tick_index: i64, + pub upper_tick_index: i64, + pub fee: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] +#[serde(rename_all = "snake_case")] +pub struct PairID { + pub token0: String, + pub token1: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct TickLiquidity { + #[serde(rename = "Liquidity")] + pub liquidity: Liquidity, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub enum Liquidity { + PoolReserves(PoolReserves), + LimitOrderTranche(LimitOrderTranche), +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct PoolReserves { + pub key: PoolReservesKey, + pub reserves_maker_denom: Int128, + pub price_taker_to_maker: String, // TODO: refactor to PrecDec + pub price_opposite_taker_to_maker: String, // TODO: refactor to PrecDec +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct PoolReservesKey { + pub trade_pair_id: TradePairID, + pub tick_index_taker_to_maker: i64, + pub fee: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct TradePairID { + pub maker_denom: String, + pub taker_denom: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct Pool { + #[serde(default)] + pub id: u64, + pub lower_tick0: Option, + pub lower_tick1: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] +#[serde(rename_all = "snake_case")] +#[serde(default)] +pub struct PoolMetadata { + pub id: u64, + pub tick: i64, + pub fee: u64, + pub pair_id: PairID, +} + +fn convert_page_request(page_request: Option) -> Option { + match page_request { + Some(p) => Some(PageRequestGen { + key: p.key.into(), + offset: p.offset, + limit: p.limit, + count_total: p.count_total, + reverse: p.reverse, + }), + None => None, + } +} From 4d3e10e41a8dde5d65d49da63a15a2e44d730b9f Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 15:36:04 +0300 Subject: [PATCH 49/77] define req and resp types for dex stargate queries and refactor respective helpers --- Cargo.toml | 1 + packages/neutron-sdk/Cargo.toml | 1 + packages/neutron-sdk/src/bindings/query.rs | 12 + packages/neutron-sdk/src/stargate/aux.rs | 56 +--- packages/neutron-sdk/src/stargate/mod.rs | 2 + packages/neutron-sdk/src/stargate/msg_dex.rs | 31 +-- .../neutron-sdk/src/stargate/query_dex.rs | 251 ++++++------------ 7 files changed, 110 insertions(+), 244 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8b330d83..6921dd7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ cosmwasm-std = "1.4.0" cw2 = "1.1.1" schemars = "0.8.15" serde = { version = "1.0.188", default-features = false } +serde_repr = { version = "0.1.17", default-features = false } serde-json-wasm = "1.0.0" cw-storage-plus = "1.1.0" cosmwasm-schema = { version = "1.4.0", default-features = false } diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index ae673016..35514808 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -12,6 +12,7 @@ readme = "README.md" cosmwasm-std = { workspace = true } cosmos-sdk-proto = { workspace = true } serde = { workspace = true } +serde_repr = { workspace = true } schemars = { workspace = true } serde-json-wasm = { workspace = true } bech32 = { workspace = true } diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index eda84639..cd0c3a09 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -90,6 +90,18 @@ pub struct PageRequest { pub reverse: bool, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub struct PageResponse { + /// **next_key** is the key to be passed to PageRequest.key to + /// query the next page most efficiently. It will be empty if + /// there are no more results. + pub next_key: Option, + /// **total** is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + pub total: Option, +} + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct QueryRegisteredQueriesResponse { diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 08b5be9b..8b64b304 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,68 +1,28 @@ -use cosmwasm_std::{ - Binary, ContractResult, CosmosMsg, Deps, Empty, QueryRequest, StdError, StdResult, - SystemResult, Timestamp, -}; -use prost::bytes::Bytes; +use cosmwasm_std::{Binary, CosmosMsg, Deps, QueryRequest, StdResult}; use prost_types::Timestamp as TimestampGen; -use serde_json_wasm::to_vec; +use serde::de::DeserializeOwned; pub(crate) fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult where Req: prost::Message, - Res: prost::Message + Default, + Res: DeserializeOwned, { - let raw = to_vec::>(&QueryRequest::Stargate { + deps.querier.query(&QueryRequest::Stargate { path: path.to_string(), data: req.encode_to_vec().into(), }) - .map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; - - match deps.querier.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err - ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( - "Querier contract error: {}", - contract_err - ))), - SystemResult::Ok(ContractResult::Ok(value)) => { - deps.api.debug( - format!( - "WASMDEBUG: stargate query raw resp: {:?}", - value.to_string() - ) - .as_str(), - ); - deps.api.debug( - format!( - "WASMDEBUG: stargate query to_base_64 resp: {:?}", - value.to_base64() - ) - .as_str(), - ); - - Res::decode(Bytes::copy_from_slice(&value)) - .map_err(|e| StdError::generic_err(e.to_string())) - } - } } -pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg -where - Req: prost::Message, -{ +pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { cosmwasm_std::CosmosMsg::Stargate { type_url: path.to_string(), value: Binary::from(req.encode_to_vec()), } } -pub(crate) fn convert_timestamp(timestamp: Timestamp) -> TimestampGen { +pub(crate) fn convert_timestamp(timestamp: u64) -> TimestampGen { TimestampGen { - seconds: i64::try_from(timestamp.seconds()).unwrap(), - nanos: i32::try_from(timestamp.subsec_nanos()).unwrap(), + seconds: timestamp as i64, + nanos: 0, } } diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index bc1be897..52a97f28 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -3,6 +3,8 @@ pub(crate) mod msg_dex; pub(crate) mod proto_types; pub(crate) mod query_dex; +pub mod types_dex; + pub mod query { pub mod neutron { pub mod dex { diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index a38c70e6..e5d812ee 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -1,11 +1,11 @@ -use crate::proto_types::neutron::dex::{ - DepositOptions as DepositOptionsGen, LimitOrderType, MsgCancelLimitOrder, MsgDeposit, - MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, -}; use crate::stargate::aux::{convert_timestamp, create_stargate_msg}; -use cosmwasm_std::{CosmosMsg, Timestamp}; -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; +use crate::stargate::proto_types::neutron::dex::{ + MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, + MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, +}; +use crate::stargate::types_dex::DepositOptions; +use crate::stargate::types_dex::LimitOrderType; +use cosmwasm_std::CosmosMsg; const DEPOSIT_MSG_PATH: &str = "/neutron.dex.MsgDeposit"; const WITHDRAWAL_MSG_PATH: &str = "/neutron.dex.MsgWithdrawal"; @@ -70,7 +70,7 @@ pub fn msg_place_limit_order( tick_index_in_to_out: i64, amount_in: String, order_type: LimitOrderType, - expiration_time: Option, + expiration_time: Option, max_amount_out: Option, ) -> CosmosMsg { let msg = MsgPlaceLimitOrder { @@ -80,7 +80,7 @@ pub fn msg_place_limit_order( token_out, tick_index_in_to_out, amount_in, - order_type: i32::from(order_type), + order_type: order_type as i32, expiration_time: expiration_time.map(convert_timestamp), max_amount_out: max_amount_out.unwrap_or_default(), }; @@ -124,16 +124,3 @@ pub fn msg_multi_hop_swap( }; create_stargate_msg(msg, MULTI_HOP_SWAP_MSG_PATH) } - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct DepositOptions { - pub disable_autoswap: bool, -} - -impl From for DepositOptionsGen { - fn from(o: DepositOptions) -> DepositOptionsGen { - DepositOptionsGen { - disable_autoswap: o.disable_autoswap, - } - } -} diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 24df9062..996d761a 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -1,23 +1,28 @@ -use crate::proto_types::neutron::dex::{ - LimitOrderType, MultiHopRoute, QueryAllInactiveLimitOrderTrancheRequest, - QueryAllInactiveLimitOrderTrancheResponse, QueryAllLimitOrderTrancheRequest, - QueryAllLimitOrderTrancheResponse, QueryAllLimitOrderTrancheUserRequest, - QueryAllLimitOrderTrancheUserResponse, QueryAllPoolMetadataRequest, - QueryAllPoolMetadataResponse, QueryAllPoolReservesRequest, QueryAllPoolReservesResponse, - QueryAllTickLiquidityRequest, QueryAllTickLiquidityResponse, QueryAllUserDepositsRequest, - QueryAllUserDepositsResponse, QueryAllUserLimitOrdersRequest, QueryAllUserLimitOrdersResponse, - QueryEstimateMultiHopSwapRequest, QueryEstimateMultiHopSwapResponse, - QueryEstimatePlaceLimitOrderRequest, QueryEstimatePlaceLimitOrderResponse, - QueryGetInactiveLimitOrderTrancheRequest, QueryGetInactiveLimitOrderTrancheResponse, - QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheResponse, - QueryGetLimitOrderTrancheUserRequest, QueryGetLimitOrderTrancheUserResponse, - QueryGetPoolMetadataRequest, QueryGetPoolMetadataResponse, QueryGetPoolReservesRequest, - QueryGetPoolReservesResponse, QueryParamsRequest, QueryParamsResponse, QueryPoolByIdRequest, - QueryPoolRequest, QueryPoolResponse, +use crate::stargate::aux::make_stargate_query; +use crate::stargate::proto_types::neutron::dex::{ + QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest, + QueryAllLimitOrderTrancheUserRequest, QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, + QueryAllTickLiquidityRequest, QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest, + QueryEstimateMultiHopSwapRequest, QueryEstimatePlaceLimitOrderRequest, + QueryGetInactiveLimitOrderTrancheRequest, QueryGetLimitOrderTrancheRequest, + QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, + QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest, }; -use crate::stargate::aux::{convert_timestamp, make_stargate_query}; -use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest; -use cosmwasm_std::{Deps, QuerierWrapper, StdResult, Timestamp}; +use crate::stargate::types_dex::{ + AllInactiveLimitOrderTrancheRequest, AllInactiveLimitOrderTrancheResponse, + AllLimitOrderTrancheRequest, AllLimitOrderTrancheResponse, AllPoolMetadataRequest, + AllPoolMetadataResponse, AllPoolReservesRequest, AllPoolReservesResponse, + AllTickLiquidityRequest, AllTickLiquidityResponse, AllUserDepositsRequest, + AllUserDepositsResponse, AllUserLimitOrdersRequest, AllUserLimitOrdersResponse, + EstimateMultiHopSwapRequest, EstimateMultiHopSwapResponse, EstimatePlaceLimitOrderRequest, + EstimatePlaceLimitOrderResponse, GetInactiveLimitOrderTrancheRequest, + GetInactiveLimitOrderTrancheResponse, GetLimitOrderTrancheRequest, + GetLimitOrderTrancheResponse, GetPoolMetadataRequest, GetPoolMetadataResponse, + GetPoolReservesRequest, GetPoolReservesResponse, LimitOrderTrancheUserAllRequest, + LimitOrderTrancheUserAllRespose, LimitOrderTrancheUserRequest, LimitOrderTrancheUserResponse, + ParamsRequest, ParamsResponse, PoolByIdRequest, PoolRequest, PoolResponse, +}; +use cosmwasm_std::{Deps, StdResult}; const PARAMS_QUERY_PATH: &str = "/neutron.dex.Query/Params"; const LIMIT_ORDER_TRANCHE_USER_QUERY_PATH: &str = "/neutron.dex.Query/LimitOrderTrancheUser"; @@ -41,281 +46,179 @@ const POOL_BY_ID_QUERY_PATH: &str = "/neutron.dex.Query/PoolByID"; const POOL_METADATA_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadata"; const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; -pub fn get_params(deps: Deps) -> StdResult { - make_stargate_query(deps, QueryParamsRequest {}, PARAMS_QUERY_PATH) +pub fn get_params(deps: Deps, req: ParamsRequest) -> StdResult { + make_stargate_query(deps, QueryParamsRequest::from(req), PARAMS_QUERY_PATH) } pub fn get_limit_order_tranche_user( deps: Deps, - address: String, - tranche_key: String, -) -> StdResult { + req: LimitOrderTrancheUserRequest, +) -> StdResult { make_stargate_query( deps, - QueryGetLimitOrderTrancheUserRequest { - address, - tranche_key, - }, + QueryGetLimitOrderTrancheUserRequest::from(req), LIMIT_ORDER_TRANCHE_USER_QUERY_PATH, ) } pub fn get_limit_order_tranche_user_all( deps: Deps, - pagination: Option, -) -> StdResult { + req: LimitOrderTrancheUserAllRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllLimitOrderTrancheUserRequest { pagination }, + QueryAllLimitOrderTrancheUserRequest::from(req), LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH, ) } pub fn get_limit_order_tranche_user_all_by_address( deps: Deps, - address: String, - pagination: Option, -) -> StdResult { + req: AllUserLimitOrdersRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllUserLimitOrdersRequest { - address, - pagination, - }, + QueryAllUserLimitOrdersRequest::from(req), LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH, ) } pub fn get_limit_order_tranche( deps: Deps, - pair_id: String, - tick_index: i64, - token_in: String, - tranche_key: String, -) -> StdResult { + req: GetLimitOrderTrancheRequest, +) -> StdResult { make_stargate_query( deps, - QueryGetLimitOrderTrancheRequest { - pair_id, - tick_index, - token_in, - tranche_key, - }, + QueryGetLimitOrderTrancheRequest::from(req), LIMIT_ORDER_TRANCHE_QUERY_PATH, ) } pub fn get_limit_order_tranche_all( deps: Deps, - pair_id: String, - token_in: String, - pagination: Option, -) -> StdResult { + req: AllLimitOrderTrancheRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllLimitOrderTrancheRequest { - pair_id, - token_in, - pagination, - }, + QueryAllLimitOrderTrancheRequest::from(req), LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, ) } pub fn get_user_deposits_all( deps: Deps, - address: String, - pagination: Option, -) -> StdResult { + req: AllUserDepositsRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllUserDepositsRequest { - address, - pagination, - }, + QueryAllUserDepositsRequest::from(req), USER_DEPOSITS_ALL_QUERY_PATH, ) } pub fn get_tick_liquidity_all( deps: Deps, - pair_id: String, - token_in: String, - pagination: Option, -) -> StdResult { + req: AllTickLiquidityRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllTickLiquidityRequest { - pair_id, - token_in, - pagination, - }, + QueryAllTickLiquidityRequest::from(req), TICK_LIQUIDITY_ALL_QUERY_PATH, ) } pub fn get_inactive_limit_order_tranche( deps: Deps, - pair_id: String, - token_in: String, - tick_index: i64, - tranche_key: String, -) -> StdResult { + req: GetInactiveLimitOrderTrancheRequest, +) -> StdResult { make_stargate_query( deps, - QueryGetInactiveLimitOrderTrancheRequest { - pair_id, - token_in, - tick_index, - tranche_key, - }, + QueryGetInactiveLimitOrderTrancheRequest::from(req), INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH, ) } pub fn get_inactive_limit_order_tranche_all( deps: Deps, - pagination: Option, -) -> StdResult { + req: AllInactiveLimitOrderTrancheRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllInactiveLimitOrderTrancheRequest { pagination }, + QueryAllInactiveLimitOrderTrancheRequest::from(req), INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, ) } pub fn get_pool_reserves_all( deps: Deps, - pair_id: String, - token_in: String, - pagination: Option, -) -> StdResult { + req: AllPoolReservesRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllPoolReservesRequest { - pair_id, - token_in, - pagination, - }, + QueryAllPoolReservesRequest::from(req), POOL_RESERVES_ALL_QUERY_PATH, ) } pub fn get_pool_reserves( deps: Deps, - pair_id: String, - token_in: String, - tick_index: i64, - fee: u64, -) -> StdResult { + req: GetPoolReservesRequest, +) -> StdResult { make_stargate_query( deps, - QueryGetPoolReservesRequest { - pair_id, - token_in, - tick_index, - fee, - }, + QueryGetPoolReservesRequest::from(req), POOL_RESERVES_QUERY_PATH, ) } pub fn get_estimate_multi_hop_swap( deps: Deps, - creator: String, - receiver: String, - routes: Vec>, - amount_in: String, - exit_limit_price: String, - pick_best_route: bool, -) -> StdResult { + req: EstimateMultiHopSwapRequest, +) -> StdResult { make_stargate_query( deps, - QueryEstimateMultiHopSwapRequest { - creator, - receiver, - routes: routes - .into_iter() - .map(|r| MultiHopRoute { hops: r }) - .collect(), - amount_in, - exit_limit_price, - pick_best_route, - }, + QueryEstimateMultiHopSwapRequest::from(req), ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH, ) } -#[allow(clippy::too_many_arguments)] pub fn get_estimate_place_limit_order( deps: Deps, - creator: String, - receiver: String, - token_in: String, - token_out: String, - tick_index_in_to_out: i64, - amount_in: String, - order_type: LimitOrderType, - expiration_time: Option, - max_amount_out: Option, -) -> StdResult { + req: EstimatePlaceLimitOrderRequest, +) -> StdResult { make_stargate_query( deps, - QueryEstimatePlaceLimitOrderRequest { - creator, - receiver, - token_in, - token_out, - tick_index_in_to_out, - amount_in, - order_type: i32::from(order_type), - expiration_time: expiration_time.map(convert_timestamp), - max_amount_out: max_amount_out.unwrap_or_default(), - }, + QueryEstimatePlaceLimitOrderRequest::from(req), ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH, ) } -pub fn get_pool( - deps: Deps, - pair_id: String, - tick_index: i64, - fee: u64, -) -> StdResult { - make_stargate_query( - deps, - QueryPoolRequest { - pair_id, - tick_index, - fee, - }, - POOL_QUERY_PATH, - ) +pub fn get_pool(deps: Deps, req: PoolRequest) -> StdResult { + make_stargate_query(deps, QueryPoolRequest::from(req), POOL_QUERY_PATH) } -pub fn get_pool_by_id(deps: Deps, pool_id: u64) -> StdResult { - make_stargate_query( - deps, - QueryPoolByIdRequest { pool_id }, - POOL_BY_ID_QUERY_PATH, - ) +pub fn get_pool_by_id(deps: Deps, req: PoolByIdRequest) -> StdResult { + make_stargate_query(deps, QueryPoolByIdRequest::from(req), POOL_BY_ID_QUERY_PATH) } -pub fn get_pool_metadata(deps: Deps, id: u64) -> StdResult { +pub fn get_pool_metadata( + deps: Deps, + req: GetPoolMetadataRequest, +) -> StdResult { make_stargate_query( deps, - QueryGetPoolMetadataRequest { id }, + QueryGetPoolMetadataRequest::from(req), POOL_METADATA_QUERY_PATH, ) } pub fn get_pool_metadata_all( deps: Deps, - pagination: Option, -) -> StdResult { + req: AllPoolMetadataRequest, +) -> StdResult { make_stargate_query( deps, - QueryAllPoolMetadataRequest { pagination }, + QueryAllPoolMetadataRequest::from(req), POOL_METADATA_ALL_QUERY_PATH, ) } From 34cdeda08ab684a079cda0d10738ae87c5361e26 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 18:30:51 +0300 Subject: [PATCH 50/77] add missing field to Params struct --- packages/neutron-sdk/src/stargate/types_dex.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 236cef42..244ca95d 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -467,6 +467,7 @@ impl From for DepositOptionsGen { #[serde(rename_all = "snake_case")] pub struct Params { pub fee_tiers: Vec, + pub max_true_taker_spread: String, } #[derive(Serialize_repr, Deserialize_repr, Clone, Debug, PartialEq, Eq, JsonSchema)] From affade55befd950c8653bf2955d2038bc5e2da81 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 18:31:03 +0300 Subject: [PATCH 51/77] debug: add stargate query resp logging --- packages/neutron-sdk/src/stargate/aux.rs | 34 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 8b64b304..0afac55e 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,4 +1,7 @@ -use cosmwasm_std::{Binary, CosmosMsg, Deps, QueryRequest, StdResult}; +use cosmwasm_std::{ + from_json, to_json_vec, to_vec, Binary, ContractResult, CosmosMsg, Deps, Empty, QueryRequest, + StdError, StdResult, SystemResult, +}; use prost_types::Timestamp as TimestampGen; use serde::de::DeserializeOwned; @@ -7,10 +10,37 @@ where Req: prost::Message, Res: DeserializeOwned, { - deps.querier.query(&QueryRequest::Stargate { + let raw = to_vec::>(&QueryRequest::Stargate { path: path.to_string(), data: req.encode_to_vec().into(), }) + .map_err(|serialize_err| { + StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + })?; + match deps.querier.raw_query(&raw) { + SystemResult::Err(system_err) => Err(StdError::generic_err(format!( + "Querier system error: {}", + system_err + ))), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( + "Querier contract error: {}", + contract_err + ))), + // response(value) is base64 encoded bytes + SystemResult::Ok(ContractResult::Ok(value)) => { + let str = value.to_base64(); + deps.api.debug( + format!( + "WASMDEBUG: raw make_stargate_query resp: {:?}", + value.to_string() + ) + .as_str(), + ); + deps.api + .debug(format!("WASMDEBUG: make_stargate_query resp: {:?}", str).as_str()); + return from_json(value); + } + } } pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { From 2666e9797f87e62d948edc480681e619f9aeee3e Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 19:05:42 +0300 Subject: [PATCH 52/77] replace primitive number types with cosmwasm_std ones deserealized in string --- packages/neutron-sdk/src/bindings/query.rs | 4 +-- .../neutron-sdk/src/stargate/types_dex.rs | 30 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/query.rs b/packages/neutron-sdk/src/bindings/query.rs index cd0c3a09..5810b8ab 100644 --- a/packages/neutron-sdk/src/bindings/query.rs +++ b/packages/neutron-sdk/src/bindings/query.rs @@ -1,5 +1,5 @@ use crate::bindings::types::{Failure, InterchainQueryResult, RegisteredQuery}; -use cosmwasm_std::{Binary, CustomQuery}; +use cosmwasm_std::{Binary, CustomQuery, Uint64}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -99,7 +99,7 @@ pub struct PageResponse { pub next_key: Option, /// **total** is total number of results available if PageRequest.count_total /// was set, its value is undefined otherwise - pub total: Option, + pub total: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 244ca95d..63afde9c 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -11,7 +11,7 @@ use crate::stargate::proto_types::neutron::dex::{ QueryPoolByIdRequest, QueryPoolRequest, }; use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen; -use cosmwasm_std::{Coin, Int128}; +use cosmwasm_std::{Coin, Int128, Int64, Timestamp, Uint64}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -466,7 +466,7 @@ impl From for DepositOptionsGen { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct Params { - pub fee_tiers: Vec, + pub fee_tiers: Vec, pub max_true_taker_spread: String, } @@ -502,7 +502,7 @@ impl TryFrom for LimitOrderType { #[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheUser { pub trade_pair_id: TradePairID, - pub tick_index_taker_to_maker: i64, + pub tick_index_taker_to_maker: Int64, pub tranche_key: String, pub address: String, pub shares_owned: Int128, @@ -515,7 +515,7 @@ pub struct LimitOrderTrancheUser { #[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheKey { pub trade_pair_id: TradePairID, - pub tick_index_taker_to_maker: i64, + pub tick_index_taker_to_maker: Int64, pub tranche_key: String, } @@ -527,7 +527,7 @@ pub struct LimitOrderTranche { pub reserves_taker_denom: Int128, pub total_maker_denom: Int128, pub total_taker_denom: Int128, - pub expiration_time: Option, + pub expiration_time: Option, pub price_taker_to_maker: String, // TODO: refactor to PrecDec } @@ -536,10 +536,10 @@ pub struct LimitOrderTranche { pub struct DepositRecord { pub pair_id: PairID, pub shares_owned: Int128, - pub center_tick_index: i64, - pub lower_tick_index: i64, - pub upper_tick_index: i64, - pub fee: Option, + pub center_tick_index: Int64, + pub lower_tick_index: Int64, + pub upper_tick_index: Int64, + pub fee: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] @@ -576,8 +576,8 @@ pub struct PoolReserves { #[serde(rename_all = "snake_case")] pub struct PoolReservesKey { pub trade_pair_id: TradePairID, - pub tick_index_taker_to_maker: i64, - pub fee: Option, + pub tick_index_taker_to_maker: Int64, + pub fee: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -591,7 +591,7 @@ pub struct TradePairID { #[serde(rename_all = "snake_case")] pub struct Pool { #[serde(default)] - pub id: u64, + pub id: Uint64, pub lower_tick0: Option, pub lower_tick1: Option, } @@ -600,9 +600,9 @@ pub struct Pool { #[serde(rename_all = "snake_case")] #[serde(default)] pub struct PoolMetadata { - pub id: u64, - pub tick: i64, - pub fee: u64, + pub id: Uint64, + pub tick: Int64, + pub fee: Uint64, pub pair_id: PairID, } From 7cd9d9e912fe73cdbe22b7a6df5a99fa8692ac7b Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 19:30:22 +0300 Subject: [PATCH 53/77] normalize stargate dex responses --- Cargo.toml | 1 + packages/neutron-sdk/Cargo.toml | 1 + packages/neutron-sdk/src/stargate/aux.rs | 4 +- packages/neutron-sdk/src/stargate/msg_dex.rs | 2 +- .../neutron-sdk/src/stargate/types_dex.rs | 69 +++++++++++-------- 5 files changed, 45 insertions(+), 32 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6921dd7f..48609e02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,4 @@ thiserror = "1.0.49" protobuf = { version = "3.3.0" } hex = "0.4.3" tendermint-proto = "0.34" +speedate = "0.13.0" diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index 35514808..206fdfd4 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -22,6 +22,7 @@ cosmwasm-schema = { workspace = true } prost = { workspace = true } prost-types = { workspace = true } tendermint-proto = { workspace = true } +speedate = { workspace = true } [dev-dependencies] base64 = { workspace = true } diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 0afac55e..7b19dab1 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -50,9 +50,9 @@ pub(crate) fn create_stargate_msg(req: Req, path: &str) -> } } -pub(crate) fn convert_timestamp(timestamp: u64) -> TimestampGen { +pub(crate) fn convert_timestamp(timestamp: i64) -> TimestampGen { TimestampGen { - seconds: timestamp as i64, + seconds: timestamp, nanos: 0, } } diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index e5d812ee..b7a8403f 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -70,7 +70,7 @@ pub fn msg_place_limit_order( tick_index_in_to_out: i64, amount_in: String, order_type: LimitOrderType, - expiration_time: Option, + expiration_time: Option, max_amount_out: Option, ) -> CosmosMsg { let msg = MsgPlaceLimitOrder { diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 63afde9c..19e57468 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -11,10 +11,10 @@ use crate::stargate::proto_types::neutron::dex::{ QueryPoolByIdRequest, QueryPoolRequest, }; use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen; -use cosmwasm_std::{Coin, Int128, Int64, Timestamp, Uint64}; +use cosmwasm_std::{Coin, Int128, Int64, Uint64}; use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; -use serde_repr::{Deserialize_repr, Serialize_repr}; +use serde::{Deserialize, Deserializer, Serialize}; +use speedate::DateTime; // Params query @@ -64,7 +64,7 @@ pub struct LimitOrderTrancheUserAllRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct LimitOrderTrancheUserAllRespose { pub limit_order_tranche_user: Vec, - pub pagination: Option, + pub pagination: Option, } impl From for QueryAllLimitOrderTrancheUserRequest { @@ -183,7 +183,7 @@ pub struct AllTickLiquidityRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct AllTickLiquidityResponse { - pub tick_liquidity: Vec, + pub tick_liquidity: Vec, pub pagination: Option, } @@ -340,7 +340,7 @@ pub struct EstimatePlaceLimitOrderRequest { pub tick_index_in_to_out: i64, pub amount_in: String, pub order_type: LimitOrderType, - pub expiration_time: Option, + pub expiration_time: Option, pub max_amount_out: Option, } @@ -418,6 +418,7 @@ pub struct GetPoolMetadataRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct GetPoolMetadataResponse { + #[serde(rename(deserialize = "Pool_metadata"))] pub pool_metadata: PoolMetadata, } @@ -464,14 +465,14 @@ impl From for DepositOptionsGen { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct Params { pub fee_tiers: Vec, pub max_true_taker_spread: String, } -#[derive(Serialize_repr, Deserialize_repr, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[repr(i32)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[schemars(with = "String")] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum LimitOrderType { GoodTilCancelled = 0, FillOrKill = 1, @@ -499,7 +500,6 @@ impl TryFrom for LimitOrderType { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheUser { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -512,7 +512,6 @@ pub struct LimitOrderTrancheUser { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheKey { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -520,19 +519,18 @@ pub struct LimitOrderTrancheKey { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTranche { pub key: LimitOrderTrancheKey, pub reserves_maker_denom: Int128, pub reserves_taker_denom: Int128, pub total_maker_denom: Int128, pub total_taker_denom: Int128, - pub expiration_time: Option, + #[serde(deserialize_with = "deserialize_expiration_time")] + pub expiration_time: Option, pub price_taker_to_maker: String, // TODO: refactor to PrecDec } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct DepositRecord { pub pair_id: PairID, pub shares_owned: Int128, @@ -543,19 +541,11 @@ pub struct DepositRecord { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] -#[serde(rename_all = "snake_case")] pub struct PairID { pub token0: String, pub token1: String, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct TickLiquidity { - #[serde(rename = "Liquidity")] - pub liquidity: Liquidity, -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum Liquidity { @@ -564,7 +554,6 @@ pub enum Liquidity { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct PoolReserves { pub key: PoolReservesKey, pub reserves_maker_denom: Int128, @@ -573,7 +562,6 @@ pub struct PoolReserves { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct PoolReservesKey { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -581,24 +569,19 @@ pub struct PoolReservesKey { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct TradePairID { pub maker_denom: String, pub taker_denom: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct Pool { - #[serde(default)] pub id: Uint64, pub lower_tick0: Option, pub lower_tick1: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] -#[serde(rename_all = "snake_case")] -#[serde(default)] pub struct PoolMetadata { pub id: Uint64, pub tick: Int64, @@ -618,3 +601,31 @@ fn convert_page_request(page_request: Option) -> Option None, } } + +fn deserialize_expiration_time<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + // Deserialize the field as an Option<&str> + let opt_date_time_string: Option<&str> = Option::deserialize(deserializer)?; + + // Convert the &str to a i64 or return None if it's None or an invalid format + match opt_date_time_string { + Some(date_time_str) => match date_time_str { + // default golang time.Time value used for JIT limit order type + "0001-01-01T00:00:00Z" => Ok(None), + + _ => Ok(Some( + DateTime::parse_str_rfc3339(date_time_str) + .map_err(|_| { + serde::de::Error::invalid_value( + serde::de::Unexpected::Str(date_time_str), + &"an RFC 3339 formatted date time", + ) + })? + .timestamp(), + )), + }, + None => Ok(None), + } +} From 0ff9d28b1643389ca016de0633958a00b94e2e8b Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 13:46:10 +0300 Subject: [PATCH 54/77] add consts and comments to dex types --- .../neutron-sdk/src/stargate/types_dex.rs | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 19e57468..8040afef 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -16,6 +16,13 @@ use schemars::JsonSchema; use serde::{Deserialize, Deserializer, Serialize}; use speedate::DateTime; +/// JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME is the default golang time.Time value used for JIT limit +/// order type in the dex module. +const JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME: &str = "0001-01-01T00:00:00Z"; +/// JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP is a mock unix timestamp value used to replace timestamp +/// calc for JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME because the timestamp for this date time is invalid. +const JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP: i64 = 0; + // Params query #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -527,7 +534,8 @@ pub struct LimitOrderTranche { pub total_taker_denom: Int128, #[serde(deserialize_with = "deserialize_expiration_time")] pub expiration_time: Option, - pub price_taker_to_maker: String, // TODO: refactor to PrecDec + /// a decimal with precision equal to 26 + pub price_taker_to_maker: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -557,8 +565,10 @@ pub enum Liquidity { pub struct PoolReserves { pub key: PoolReservesKey, pub reserves_maker_denom: Int128, - pub price_taker_to_maker: String, // TODO: refactor to PrecDec - pub price_opposite_taker_to_maker: String, // TODO: refactor to PrecDec + /// a decimal with precision equal to 26 + pub price_taker_to_maker: String, + /// a decimal with precision equal to 26 + pub price_opposite_taker_to_maker: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] @@ -602,6 +612,12 @@ fn convert_page_request(page_request: Option) -> Option(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, @@ -609,12 +625,13 @@ where // Deserialize the field as an Option<&str> let opt_date_time_string: Option<&str> = Option::deserialize(deserializer)?; - // Convert the &str to a i64 or return None if it's None or an invalid format match opt_date_time_string { + None => Ok(None), + Some(date_time_str) => match date_time_str { - // default golang time.Time value used for JIT limit order type - "0001-01-01T00:00:00Z" => Ok(None), + JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME => Ok(Some(JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP)), + // some RFC 3339 formatted date time to be parsed to a unix timestamp _ => Ok(Some( DateTime::parse_str_rfc3339(date_time_str) .map_err(|_| { @@ -626,6 +643,5 @@ where .timestamp(), )), }, - None => Ok(None), } } From 8a4d48b6efdd814f598dd5f06493f1d7bc3ac9e8 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 13:46:21 +0300 Subject: [PATCH 55/77] remove debug logging for make_stargate_query --- packages/neutron-sdk/src/stargate/aux.rs | 34 ++---------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 7b19dab1..99a957df 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -1,7 +1,4 @@ -use cosmwasm_std::{ - from_json, to_json_vec, to_vec, Binary, ContractResult, CosmosMsg, Deps, Empty, QueryRequest, - StdError, StdResult, SystemResult, -}; +use cosmwasm_std::{Binary, CosmosMsg, Deps, QueryRequest, StdResult}; use prost_types::Timestamp as TimestampGen; use serde::de::DeserializeOwned; @@ -10,37 +7,10 @@ where Req: prost::Message, Res: DeserializeOwned, { - let raw = to_vec::>(&QueryRequest::Stargate { + deps.querier.query(&QueryRequest::Stargate { path: path.to_string(), data: req.encode_to_vec().into(), }) - .map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; - match deps.querier.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err - ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( - "Querier contract error: {}", - contract_err - ))), - // response(value) is base64 encoded bytes - SystemResult::Ok(ContractResult::Ok(value)) => { - let str = value.to_base64(); - deps.api.debug( - format!( - "WASMDEBUG: raw make_stargate_query resp: {:?}", - value.to_string() - ) - .as_str(), - ); - deps.api - .debug(format!("WASMDEBUG: make_stargate_query resp: {:?}", str).as_str()); - return from_json(value); - } - } } pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { From a3e0cc9c3a6ded68863a541199c9f8dc6d31b4e1 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 13:48:36 +0300 Subject: [PATCH 56/77] rm proto-build dir --- Cargo.toml | 1 - proto-build/Cargo.toml | 14 -- proto-build/buf.neutron.gen.yaml | 8 - proto-build/src/main.rs | 315 ------------------------------- 4 files changed, 338 deletions(-) delete mode 100644 proto-build/Cargo.toml delete mode 100644 proto-build/buf.neutron.gen.yaml delete mode 100644 proto-build/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 48609e02..0fca3acc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = ["contracts/*", "packages/*"] -exclude = ["proto-build"] [profile.release] opt-level = 3 diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml deleted file mode 100644 index 4f97ead2..00000000 --- a/proto-build/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "proto-build" -version = "0.1.0" -authors = ["Justin Kilpatrick ", "Tony Arcieri "] -edition = "2018" -publish = false - -[dependencies] -prost = "0.12" -prost-build = "0.12" -tonic = "0.10" -tonic-build = "0.10" -regex = "1" -walkdir = "2" diff --git a/proto-build/buf.neutron.gen.yaml b/proto-build/buf.neutron.gen.yaml deleted file mode 100644 index 17b5bb6e..00000000 --- a/proto-build/buf.neutron.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - plugin: buf.build/community/neoeinstein-prost:v0.2.1 - out: . - - plugin: buf.build/community/neoeinstein-tonic:v0.3.0 - out: . - opt: - - no_server=true diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs deleted file mode 100644 index b9c420da..00000000 --- a/proto-build/src/main.rs +++ /dev/null @@ -1,315 +0,0 @@ -//! Build CosmosSDK/Tendermint/IBC proto files. This build script clones the CosmosSDK version -//! specified in the COSMOS_SDK_REV constant and then uses that to build the required -//! proto files for further compilation. This is based on the proto-compiler code -//! in github.com/informalsystems/ibc-rs - -use regex::Regex; -use std::{ - env, - ffi::{OsStr, OsString}, - fs::{self, create_dir_all, remove_dir_all}, - io, - path::{Path, PathBuf}, - process, - sync::atomic::{self, AtomicBool}, -}; -use walkdir::WalkDir; - -/// Suppress log messages -// TODO(tarcieri): use a logger for this -static QUIET: AtomicBool = AtomicBool::new(false); - -// All paths must end with a / and either be absolute or include a ./ to reference the current -// working directory. - -const COSMOS_SDK_PROTO_DIR: &str = "../packages/neutron-sdk/src/proto_types"; - -/// The directory generated cosmos-sdk proto files go into in this repo -const TMP_BUILD_DIR: &str = "/tmp/tmp-protobuf/"; - -const NEUTRON_DIR: &str = "../neutron"; -const NEUTRON_REV: &str = "83770b74d18b5f5e90c7b0514c7e13a0558af30a"; // merge_duality_neutron; - -// Patch strings used by `copy_and_patch` - -/// Protos belonging to these Protobuf packages will be excluded -/// (i.e. because they are sourced from `tendermint-proto`) -const EXCLUDED_PROTO_PACKAGES: &[&str] = &["gogoproto", "google", "tendermint"]; - -/// Log info to the console (if `QUIET` is disabled) -// TODO(tarcieri): use a logger for this -macro_rules! info { - ($msg:expr) => { - if !is_quiet() { - println!("[info] {}", $msg) - } - }; - ($fmt:expr, $($arg:tt)+) => { - info!(&format!($fmt, $($arg)+)) - }; -} - -fn main() { - if is_github() { - set_quiet(); - } - - let tmp_build_dir: PathBuf = TMP_BUILD_DIR.parse().unwrap(); - let proto_dir: PathBuf = COSMOS_SDK_PROTO_DIR.parse().unwrap(); - - if tmp_build_dir.exists() { - fs::remove_dir_all(tmp_build_dir.clone()).unwrap(); - } - - let temp_neutron_dir = tmp_build_dir.join("neutron"); - - fs::create_dir_all(&temp_neutron_dir).unwrap(); - - update_submodules(); - output_neutron_version(&temp_neutron_dir); - compile_neutron_proto_and_services(&temp_neutron_dir); - - copy_generated_files(&temp_neutron_dir, &proto_dir.join("neutron")); - - // apply_patches(&proto_dir); - - info!("Running rustfmt on prost/tonic-generated code"); - run_rustfmt(&proto_dir); - - if is_github() { - println!( - "Rebuild protos with proto-build (neutron-rev: {}))", - NEUTRON_REV - ); - } -} - -fn is_quiet() -> bool { - QUIET.load(atomic::Ordering::Relaxed) -} - -fn set_quiet() { - QUIET.store(true, atomic::Ordering::Relaxed); -} - -/// Parse `--github` flag passed to `proto-build` on the eponymous GitHub Actions job. -/// Disables `info`-level log messages, instead outputting only a commit message. -fn is_github() -> bool { - env::args().any(|arg| arg == "--github") -} - -fn run_cmd(cmd: impl AsRef, args: impl IntoIterator>) { - let stdout = if is_quiet() { - process::Stdio::null() - } else { - process::Stdio::inherit() - }; - - let exit_status = process::Command::new(&cmd) - .args(args) - .stdout(stdout) - .status() - .unwrap_or_else(|e| match e.kind() { - io::ErrorKind::NotFound => panic!( - "error running '{:?}': command not found. Is it installed?", - cmd.as_ref() - ), - _ => panic!("error running '{:?}': {:?}", cmd.as_ref(), e), - }); - - if !exit_status.success() { - match exit_status.code() { - Some(code) => panic!("{:?} exited with error code: {:?}", cmd.as_ref(), code), - None => panic!("{:?} exited without error code", cmd.as_ref()), - } - } -} - -fn run_buf(config: &str, proto_path: impl AsRef, out_dir: impl AsRef) { - run_cmd( - "buf", - [ - "generate", - "--template", - config, - "--include-imports", - "-o", - &out_dir.as_ref().display().to_string(), - &proto_path.as_ref().display().to_string(), - ], - ); -} - -fn run_git(args: impl IntoIterator>) { - run_cmd("git", args) -} - -fn run_rustfmt(dir: &Path) { - let mut args = ["--edition", "2021"] - .iter() - .map(Into::into) - .collect::>(); - - args.extend( - WalkDir::new(dir) - .into_iter() - .filter_map(|e| e.ok()) - .filter(|e| e.file_type().is_file() && e.path().extension() == Some(OsStr::new("rs"))) - .map(|e| e.into_path()) - .map(Into::into), - ); - - run_cmd("rustfmt", args); -} - -fn update_submodules() { - info!("Updating neutron submodule..."); - run_git(["submodule", "update", "--init"]); - run_git(["-C", NEUTRON_DIR, "fetch"]); - run_git(["-C", NEUTRON_DIR, "reset", "--hard", NEUTRON_REV]); -} - -fn output_neutron_version(out_dir: &Path) { - let path = out_dir.join("NEUTRON_COMMIT"); - fs::write(path, NEUTRON_REV).unwrap(); -} - -fn compile_neutron_proto_and_services(out_dir: &Path) { - let sdk_dir = Path::new(NEUTRON_DIR); - let proto_path = sdk_dir.join("proto"); - let proto_paths = [ - // format!("{}/third_party/proto/ibc", sdk_dir.display()), - // format!("{}/proto/neutron/dex", sdk_dir.display()), - ]; - - // List available proto files - let mut protos: Vec = vec![]; - collect_protos(&proto_paths, &mut protos); - - // Compile all proto client for GRPC services - info!("Compiling neutron proto clients for GRPC services!"); - run_buf("buf.neutron.gen.yaml", proto_path, out_dir); - info!("=> Done!"); -} - -/// collect_protos walks every path in `proto_paths` and recursively locates all .proto -/// files in each path's subdirectories, adding the full path of each file to `protos` -/// -/// Any errors encountered will cause failure for the path provided to WalkDir::new() -fn collect_protos(proto_paths: &[String], protos: &mut Vec) { - for proto_path in proto_paths { - protos.append( - &mut WalkDir::new(proto_path) - .into_iter() - .filter_map(|e| e.ok()) - .filter(|e| { - e.file_type().is_file() - && e.path().extension().is_some() - && e.path().extension().unwrap() == "proto" - }) - .map(|e| e.into_path()) - .collect(), - ); - } -} - -fn copy_generated_files(from_dir: &Path, to_dir: &Path) { - info!("Copying generated files into '{}'...", to_dir.display()); - - // Remove old compiled files - remove_dir_all(to_dir).unwrap_or_default(); - create_dir_all(to_dir).unwrap(); - - let mut filenames = Vec::new(); - - // Copy new compiled files (prost does not use folder structures) - let errors = WalkDir::new(from_dir) - .into_iter() - .filter_map(|e| e.ok()) - .filter(|e| e.file_type().is_file()) - .map(|e| { - let filename = e.file_name().to_os_string().to_str().unwrap().to_string(); - filenames.push(filename.clone()); - copy_and_patch(e.path(), format!("{}/{}", to_dir.display(), &filename)) - }) - .filter_map(|e| e.err()) - .collect::>(); - - if !errors.is_empty() { - for e in errors { - eprintln!("[error] Error while copying compiled file: {}", e); - } - - panic!("[error] Aborted."); - } -} - -fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<()> { - /// Regex substitutions to apply to the prost-generated output - const REPLACEMENTS: &[(&str, &str)] = &[ - // Use `tendermint-proto` proto definitions - ("(super::)+tendermint", "tendermint_proto"), - // Feature-gate gRPC client modules - ( - "/// Generated client implementations.", - "/// Generated client implementations.\n\ - #[cfg(feature = \"grpc\")]", - ), - // Feature-gate gRPC impls which use `tonic::transport` - ( - "impl(.+)tonic::transport(.+)", - "#[cfg(feature = \"grpc-transport\")]\n \ - impl${1}tonic::transport${2}", - ), - // Feature-gate gRPC server modules - ( - "/// Generated server implementations.", - "/// Generated server implementations.\n\ - #[cfg(feature = \"grpc\")]", - ), - ]; - - // Skip proto files belonging to `EXCLUDED_PROTO_PACKAGES` - for package in EXCLUDED_PROTO_PACKAGES { - if let Some(filename) = src.as_ref().file_name().and_then(OsStr::to_str) { - if filename.starts_with(&format!("{}.", package)) { - return Ok(()); - } - } - } - - let mut contents = fs::read_to_string(src)?; - - for &(regex, replacement) in REPLACEMENTS { - contents = Regex::new(regex) - .unwrap_or_else(|_| panic!("invalid regex: {}", regex)) - .replace_all(&contents, replacement) - .to_string(); - } - - fs::write(dest, &contents) -} - -// fn patch_file(path: impl AsRef, pattern: &Regex, replacement: &str) -> io::Result<()> { -// let mut contents = fs::read_to_string(&path)?; -// contents = pattern.replace_all(&contents, replacement).to_string(); -// fs::write(path, &contents) -// } - -// Fix clashing type names in prost-generated code. See cosmos/cosmos-rust#154. -// fn apply_patches(proto_dir: &Path) { -// for (pattern, replacement) in [ -// ("enum Validators", "enum Policy"), -// ( -// "stake_authorization::Validators", -// "stake_authorization::Policy", -// ), -// ] { -// patch_file( -// &proto_dir.join("cosmos-sdk/cosmos.staking.v1beta1.rs"), -// &Regex::new(pattern).unwrap(), -// replacement, -// ) -// .expect("error patching cosmos.staking.v1beta1.rs"); -// } -// } From c87c96a14454de32f804221504fd287d27503225 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 13:49:34 +0300 Subject: [PATCH 57/77] rm neutron submodule --- .gitmodules | 3 --- neutron | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 neutron diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index afa0c8f3..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "neutron"] - path = neutron - url = https://github.com/neutron-org/neutron.git diff --git a/neutron b/neutron deleted file mode 160000 index 83770b74..00000000 --- a/neutron +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 83770b74d18b5f5e90c7b0514c7e13a0558af30a From bca1b5980c0b3dac90deaf067975722d95a4867f Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 14:11:04 +0300 Subject: [PATCH 58/77] remove the rest of the proto build stuff --- Makefile | 5 +---- build_proto.sh | 12 ------------ proto/transfer/v1/transfer.proto | 12 ------------ thirdparty/protoc-image/Dockerfile | 26 -------------------------- 4 files changed, 1 insertion(+), 54 deletions(-) delete mode 100755 build_proto.sh delete mode 100644 proto/transfer/v1/transfer.proto delete mode 100644 thirdparty/protoc-image/Dockerfile diff --git a/Makefile b/Makefile index 73883462..58fe610d 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,6 @@ clippy: fmt: @cargo fmt -- --check -build_proto: - @./build_proto.sh - compile: @./build_release.sh @@ -23,4 +20,4 @@ check_contracts: @cargo install cosmwasm-check @cosmwasm-check --available-capabilities iterator,staking,stargate,neutron artifacts/*.wasm -build: build_proto schema clippy test fmt compile check_contracts \ No newline at end of file +build: schema clippy test fmt compile check_contracts \ No newline at end of file diff --git a/build_proto.sh b/build_proto.sh deleted file mode 100755 index 60085ea2..00000000 --- a/build_proto.sh +++ /dev/null @@ -1,12 +0,0 @@ -docker build thirdparty/protoc-image -t protoc_builder - -docker run --rm \ --v $PWD:/opt \ -protoc_builder sh -c "protoc \ --I/opt/proto \ -/opt/proto/gogoproto/*.proto \ -/opt/proto/cosmos_proto/*.proto \ -/opt/proto/cosmos/bank/v1beta1/bank.proto \ -/opt/proto/transfer/v1/*.proto \ -/opt/proto/neutron/dex/*.proto \ ---rust_out /opt/packages/neutron-sdk/src/proto_types/" diff --git a/proto/transfer/v1/transfer.proto b/proto/transfer/v1/transfer.proto deleted file mode 100644 index 4ffe586f..00000000 --- a/proto/transfer/v1/transfer.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package neutron.transfer; - -// MsgTransferResponse is the modified response type for -// ibc-go MsgTransfer. -message MsgTransferResponse { - // channel's sequence_id for outgoing ibc packet. Unique per a channel. - uint64 sequence_id = 1; - // channel src channel on neutron side transaction was submitted from - string channel = 2; -} diff --git a/thirdparty/protoc-image/Dockerfile b/thirdparty/protoc-image/Dockerfile deleted file mode 100644 index 683c3073..00000000 --- a/thirdparty/protoc-image/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM rust:1.71.0 - -ENV PROTOC_VERSION 3.20.0 - -RUN set -x; \ - export PROTOC_ZIP=$(echo "protoc-$PROTOC_VERSION-linux-$(uname -m).zip" | sed 's/aarch/aarch_/g'); \ - apt update \ - && apt install -y \ - clang \ - cmake \ - lcov \ - libudev-dev \ - mscgen \ - net-tools \ - rsync \ - sudo \ - golang \ - unzip \ - \ - && apt remove -y libcurl4-openssl-dev \ - && rm -rf /var/lib/apt/lists/* \ - && curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \ - && unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \ - && unzip -o $PROTOC_ZIP -d /usr/local include/* \ - && rm -f $PROTOC_ZIP \ - && cargo install protobuf-codegen --version 3.3.0 --locked From 560743c772386428987430b873d7efbb48348e45 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 14:11:31 +0300 Subject: [PATCH 59/77] reflect and describe stargate package in readme --- README.md | 2 +- packages/neutron-sdk/src/stargate/README.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 packages/neutron-sdk/src/stargate/README.md diff --git a/README.md b/README.md index 2cff54ec..83c437c3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The Neutron SDK is contained inside `packages` folder and consists of the follow | Neutron Bindings | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/bindings | Structures and helper methods for interacting with Neutron blockchain | | Neutron Sudo | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/sudo | Structures for Sudo Contract callbacks from Neutron blockchain | | Neutron Errors | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/errors | Structures and helpers for Neutron specific error and result types | -| Neutron Proto Types | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/proto_types | Neutron specific protobuf types. | +| Neutron Stargate | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate | Structures and helpers for interacting with Neutron via Stargate | ### Example Contracts diff --git a/packages/neutron-sdk/src/stargate/README.md b/packages/neutron-sdk/src/stargate/README.md new file mode 100644 index 00000000..cef92567 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/README.md @@ -0,0 +1,11 @@ +# Neutron Stargate interface + +This package contains list of helpers to interact with Neutron blockchain via Stargate. + +### Dex module + +For the `dex` module, there are helpers for all possible messages and queries in the package. The helpers have manually written adapted types for requests and responses instead of proto generated ones because proto-gen works poorly with rust code as the output. + +- helpers to construct CosmosMsgs to the dex module are placed in the [msg_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/msg_dex.rs) file; +- helpers to retrieve data from the dex module are placed in the [query_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/query_dex.rs) file; +- different types (e.g. request/response types) are placed in the [types_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/types_dex.rs) file. From 1599d46662939822c3bcfa0e240ff014f5c1f7f7 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 14:27:56 +0300 Subject: [PATCH 60/77] refactor dex msg helpers with accepting request structures --- packages/neutron-sdk/src/stargate/msg_dex.rs | 124 +++---------- .../neutron-sdk/src/stargate/types_dex.rs | 173 +++++++++++++++++- 2 files changed, 184 insertions(+), 113 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index b7a8403f..b1b12227 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -1,10 +1,12 @@ -use crate::stargate::aux::{convert_timestamp, create_stargate_msg}; +use crate::stargate::aux::create_stargate_msg; use crate::stargate::proto_types::neutron::dex::{ MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, - MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, + MsgWithdrawFilledLimitOrder, MsgWithdrawal, +}; +use crate::stargate::types_dex::{ + CancelLimitOrderRequest, DepositRequest, MultiHopSwapRequest, PlaceLimitOrderRequest, + WithdrawFilledLimitOrderRequest, WithdrawalRequest, }; -use crate::stargate::types_dex::DepositOptions; -use crate::stargate::types_dex::LimitOrderType; use cosmwasm_std::CosmosMsg; const DEPOSIT_MSG_PATH: &str = "/neutron.dex.MsgDeposit"; @@ -14,113 +16,29 @@ const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgWithdrawFill const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgCancelLimitOrder"; const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; -#[allow(clippy::too_many_arguments)] -pub fn msg_deposit( - sender: String, - receiver: String, - token_a: String, - token_b: String, - amounts_a: Vec, - amounts_b: Vec, - tick_indexes_a_to_b: Vec, - fees: Vec, - options: Vec, -) -> CosmosMsg { - let msg = MsgDeposit { - creator: sender, - receiver, - token_a, - token_b, - amounts_a, - amounts_b, - tick_indexes_a_to_b, - fees, - options: options.into_iter().map(|o| o.into()).collect(), - }; - create_stargate_msg(msg, DEPOSIT_MSG_PATH) +pub fn msg_deposit(req: DepositRequest) -> CosmosMsg { + create_stargate_msg(MsgDeposit::from(req), DEPOSIT_MSG_PATH) } -pub fn msg_withdrawal( - sender: String, - receiver: String, - token_a: String, - token_b: String, - shares_to_remove: Vec, - tick_indexes_a_to_b: Vec, - fees: Vec, -) -> CosmosMsg { - let msg = MsgWithdrawal { - creator: sender, - receiver, - token_a, - token_b, - shares_to_remove, - tick_indexes_a_to_b, - fees, - }; - create_stargate_msg(msg, WITHDRAWAL_MSG_PATH) +pub fn msg_withdrawal(req: WithdrawalRequest) -> CosmosMsg { + create_stargate_msg(MsgWithdrawal::from(req), WITHDRAWAL_MSG_PATH) } -#[allow(clippy::too_many_arguments)] -pub fn msg_place_limit_order( - sender: String, - receiver: String, - token_in: String, - token_out: String, - tick_index_in_to_out: i64, - amount_in: String, - order_type: LimitOrderType, - expiration_time: Option, - max_amount_out: Option, -) -> CosmosMsg { - let msg = MsgPlaceLimitOrder { - creator: sender, - receiver, - token_in, - token_out, - tick_index_in_to_out, - amount_in, - order_type: order_type as i32, - expiration_time: expiration_time.map(convert_timestamp), - max_amount_out: max_amount_out.unwrap_or_default(), - }; - create_stargate_msg(msg, PLACE_LIMIT_ORDER_MSG_PATH) +pub fn msg_place_limit_order(req: PlaceLimitOrderRequest) -> CosmosMsg { + create_stargate_msg(MsgPlaceLimitOrder::from(req), PLACE_LIMIT_ORDER_MSG_PATH) } -pub fn msg_withdraw_filled_limit_order(sender: String, tranche_key: String) -> CosmosMsg { - let msg = MsgWithdrawFilledLimitOrder { - creator: sender, - tranche_key, - }; - create_stargate_msg(msg, WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH) +pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> CosmosMsg { + create_stargate_msg( + MsgWithdrawFilledLimitOrder::from(req), + WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH, + ) } -pub fn msg_cancel_limit_order(sender: String, tranche_key: String) -> CosmosMsg { - let msg = MsgCancelLimitOrder { - creator: sender, - tranche_key, - }; - create_stargate_msg(msg, CANCEL_LIMIT_ORDER_MSG_PATH) +pub fn msg_cancel_limit_order(req: CancelLimitOrderRequest) -> CosmosMsg { + create_stargate_msg(MsgCancelLimitOrder::from(req), CANCEL_LIMIT_ORDER_MSG_PATH) } -pub fn msg_multi_hop_swap( - sender: String, - receiver: String, - routes: Vec>, - amount_in: String, - exit_limit_price: String, - pick_best_route: bool, -) -> CosmosMsg { - let msg = MsgMultiHopSwap { - creator: sender, - receiver, - routes: routes - .into_iter() - .map(|r| MultiHopRoute { hops: r }) - .collect(), - amount_in, - exit_limit_price, - pick_best_route, - }; - create_stargate_msg(msg, MULTI_HOP_SWAP_MSG_PATH) +pub fn msg_multi_hop_swap(req: MultiHopSwapRequest) -> CosmosMsg { + create_stargate_msg(MsgMultiHopSwap::from(req), MULTI_HOP_SWAP_MSG_PATH) } diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 8040afef..3dd6ac5d 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -1,14 +1,15 @@ use crate::bindings::query::{PageRequest, PageResponse}; use crate::stargate::aux::convert_timestamp; use crate::stargate::proto_types::neutron::dex::{ - DepositOptions as DepositOptionsGen, MultiHopRoute, QueryAllInactiveLimitOrderTrancheRequest, - QueryAllLimitOrderTrancheRequest, QueryAllLimitOrderTrancheUserRequest, - QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, QueryAllTickLiquidityRequest, - QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest, QueryEstimateMultiHopSwapRequest, - QueryEstimatePlaceLimitOrderRequest, QueryGetInactiveLimitOrderTrancheRequest, - QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheUserRequest, - QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest, - QueryPoolByIdRequest, QueryPoolRequest, + DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, + MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, + QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest, + QueryAllLimitOrderTrancheUserRequest, QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, + QueryAllTickLiquidityRequest, QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest, + QueryEstimateMultiHopSwapRequest, QueryEstimatePlaceLimitOrderRequest, + QueryGetInactiveLimitOrderTrancheRequest, QueryGetLimitOrderTrancheRequest, + QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, + QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest, }; use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen; use cosmwasm_std::{Coin, Int128, Int64, Uint64}; @@ -18,10 +19,162 @@ use speedate::DateTime; /// JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME is the default golang time.Time value used for JIT limit /// order type in the dex module. -const JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME: &str = "0001-01-01T00:00:00Z"; +pub const JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME: &str = "0001-01-01T00:00:00Z"; /// JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP is a mock unix timestamp value used to replace timestamp /// calc for JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME because the timestamp for this date time is invalid. -const JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP: i64 = 0; +pub const JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP: i64 = 0; + +// Deposit message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct DepositRequest { + pub sender: String, + pub receiver: String, + pub token_a: String, + pub token_b: String, + pub amounts_a: Vec, + pub amounts_b: Vec, + pub tick_indexes_a_to_b: Vec, + pub fees: Vec, + pub options: Vec, +} + +impl From for MsgDeposit { + fn from(v: DepositRequest) -> MsgDeposit { + MsgDeposit { + creator: v.sender, + receiver: v.receiver, + token_a: v.token_a, + token_b: v.token_b, + amounts_a: v.amounts_a, + amounts_b: v.amounts_b, + tick_indexes_a_to_b: v.tick_indexes_a_to_b, + fees: v.fees, + options: v.options.into_iter().map(|o| o.into()).collect(), + } + } +} + +// Withdrawal message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct WithdrawalRequest { + pub sender: String, + pub receiver: String, + pub token_a: String, + pub token_b: String, + pub shares_to_remove: Vec, + pub tick_indexes_a_to_b: Vec, + pub fees: Vec, +} + +impl From for MsgWithdrawal { + fn from(v: WithdrawalRequest) -> MsgWithdrawal { + MsgWithdrawal { + creator: v.sender, + receiver: v.receiver, + token_a: v.token_a, + token_b: v.token_b, + shares_to_remove: v.shares_to_remove, + tick_indexes_a_to_b: v.tick_indexes_a_to_b, + fees: v.fees, + } + } +} + +// PlaceLimitOrder message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct PlaceLimitOrderRequest { + pub sender: String, + pub receiver: String, + pub token_in: String, + pub token_out: String, + pub tick_index_in_to_out: i64, + pub amount_in: String, + pub order_type: LimitOrderType, + pub expiration_time: Option, + pub max_amount_out: Option, +} + +impl From for MsgPlaceLimitOrder { + fn from(v: PlaceLimitOrderRequest) -> MsgPlaceLimitOrder { + MsgPlaceLimitOrder { + creator: v.sender, + receiver: v.receiver, + token_in: v.token_in, + token_out: v.token_out, + tick_index_in_to_out: v.tick_index_in_to_out, + amount_in: v.amount_in, + order_type: v.order_type as i32, + expiration_time: v.expiration_time.map(convert_timestamp), + max_amount_out: v.max_amount_out.unwrap_or_default(), + } + } +} + +// WithdrawFilledLimitOrder message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct WithdrawFilledLimitOrderRequest { + pub sender: String, + pub tranche_key: String, +} + +impl From for MsgWithdrawFilledLimitOrder { + fn from(v: WithdrawFilledLimitOrderRequest) -> MsgWithdrawFilledLimitOrder { + MsgWithdrawFilledLimitOrder { + creator: v.sender, + tranche_key: v.tranche_key, + } + } +} + +// CancelLimitOrder message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct CancelLimitOrderRequest { + pub sender: String, + pub tranche_key: String, +} + +impl From for MsgCancelLimitOrder { + fn from(v: CancelLimitOrderRequest) -> MsgCancelLimitOrder { + MsgCancelLimitOrder { + creator: v.sender, + tranche_key: v.tranche_key, + } + } +} + +// MultiHopSwap message + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct MultiHopSwapRequest { + pub sender: String, + pub receiver: String, + pub routes: Vec>, + pub amount_in: String, + pub exit_limit_price: String, + pub pick_best_route: bool, +} + +impl From for MsgMultiHopSwap { + fn from(v: MultiHopSwapRequest) -> MsgMultiHopSwap { + MsgMultiHopSwap { + creator: v.sender, + receiver: v.receiver, + routes: v + .routes + .into_iter() + .map(|r| MultiHopRoute { hops: r }) + .collect(), + amount_in: v.amount_in, + exit_limit_price: v.exit_limit_price, + pick_best_route: v.pick_best_route, + } + } +} // Params query From dd81e0e3191a74acbb39bbc98944d4d4e7692fb0 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 14:58:35 +0300 Subject: [PATCH 61/77] rm serde_repr from deps --- Cargo.toml | 1 - packages/neutron-sdk/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0fca3acc..7c671fdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ cosmwasm-std = "1.4.0" cw2 = "1.1.1" schemars = "0.8.15" serde = { version = "1.0.188", default-features = false } -serde_repr = { version = "0.1.17", default-features = false } serde-json-wasm = "1.0.0" cw-storage-plus = "1.1.0" cosmwasm-schema = { version = "1.4.0", default-features = false } diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index 206fdfd4..36d63798 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -12,7 +12,6 @@ readme = "README.md" cosmwasm-std = { workspace = true } cosmos-sdk-proto = { workspace = true } serde = { workspace = true } -serde_repr = { workspace = true } schemars = { workspace = true } serde-json-wasm = { workspace = true } bech32 = { workspace = true } From 96c7f860c30c9ccd2c426f75359c12771178f035 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 14:58:44 +0300 Subject: [PATCH 62/77] make proto_types package public --- packages/neutron-sdk/src/stargate/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 52a97f28..4efade73 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -1,8 +1,8 @@ pub(crate) mod aux; pub(crate) mod msg_dex; -pub(crate) mod proto_types; pub(crate) mod query_dex; +pub mod proto_types; pub mod types_dex; pub mod query { From 558dcbe5c741cc5751ca6ade1f8db29c8ab47bbd Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 19:22:02 +0300 Subject: [PATCH 63/77] fix misprint in LimitOrderTrancheUserAllResponse type name --- packages/neutron-sdk/src/stargate/query_dex.rs | 4 ++-- packages/neutron-sdk/src/stargate/types_dex.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 996d761a..843f16a3 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -19,7 +19,7 @@ use crate::stargate::types_dex::{ GetInactiveLimitOrderTrancheResponse, GetLimitOrderTrancheRequest, GetLimitOrderTrancheResponse, GetPoolMetadataRequest, GetPoolMetadataResponse, GetPoolReservesRequest, GetPoolReservesResponse, LimitOrderTrancheUserAllRequest, - LimitOrderTrancheUserAllRespose, LimitOrderTrancheUserRequest, LimitOrderTrancheUserResponse, + LimitOrderTrancheUserAllResponse, LimitOrderTrancheUserRequest, LimitOrderTrancheUserResponse, ParamsRequest, ParamsResponse, PoolByIdRequest, PoolRequest, PoolResponse, }; use cosmwasm_std::{Deps, StdResult}; @@ -64,7 +64,7 @@ pub fn get_limit_order_tranche_user( pub fn get_limit_order_tranche_user_all( deps: Deps, req: LimitOrderTrancheUserAllRequest, -) -> StdResult { +) -> StdResult { make_stargate_query( deps, QueryAllLimitOrderTrancheUserRequest::from(req), diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 3dd6ac5d..66dc785a 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -222,7 +222,7 @@ pub struct LimitOrderTrancheUserAllRequest { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct LimitOrderTrancheUserAllRespose { +pub struct LimitOrderTrancheUserAllResponse { pub limit_order_tranche_user: Vec, pub pagination: Option, } From f3b1800de15ab58e56072377ee701aacd4459b0b Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Tue, 5 Dec 2023 19:22:19 +0300 Subject: [PATCH 64/77] replace expiration_time i64 type with Int64 --- packages/neutron-sdk/src/stargate/types_dex.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 66dc785a..aa574b02 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -686,7 +686,7 @@ pub struct LimitOrderTranche { pub total_maker_denom: Int128, pub total_taker_denom: Int128, #[serde(deserialize_with = "deserialize_expiration_time")] - pub expiration_time: Option, + pub expiration_time: Option, /// a decimal with precision equal to 26 pub price_taker_to_maker: String, } @@ -771,7 +771,7 @@ fn convert_page_request(page_request: Option) -> Option(deserializer: D) -> Result, D::Error> +fn deserialize_expiration_time<'de, D>(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, { @@ -782,7 +782,9 @@ where None => Ok(None), Some(date_time_str) => match date_time_str { - JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME => Ok(Some(JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP)), + JIT_LIMIT_ORDER_TYPE_EXP_DATE_TIME => { + Ok(Some(JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP.into())) + } // some RFC 3339 formatted date time to be parsed to a unix timestamp _ => Ok(Some( @@ -793,7 +795,8 @@ where &"an RFC 3339 formatted date time", ) })? - .timestamp(), + .timestamp() + .into(), )), }, } From 937865cdde262a306690d089e3d2ecf77f9d182e Mon Sep 17 00:00:00 2001 From: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:16:38 +0300 Subject: [PATCH 65/77] rm redundant lib prefix for CosmosMsg::Stargate Co-authored-by: Mike Mozhaev --- packages/neutron-sdk/src/stargate/aux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 99a957df..733e8b5c 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -14,7 +14,7 @@ where } pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { - cosmwasm_std::CosmosMsg::Stargate { + CosmosMsg::Stargate { type_url: path.to_string(), value: Binary::from(req.encode_to_vec()), } From f8a4721ac2788aa9fb4686f3529adddba9a1b4b9 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 11 Dec 2023 12:32:11 +0300 Subject: [PATCH 66/77] add comments for make_stargate_query and create_stargate_msg --- packages/neutron-sdk/src/stargate/aux.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 733e8b5c..7de892ed 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -2,6 +2,15 @@ use cosmwasm_std::{Binary, CosmosMsg, Deps, QueryRequest, StdResult}; use prost_types::Timestamp as TimestampGen; use serde::de::DeserializeOwned; +/// makes a stargate query by a given path and req and returns a response deserialised into a +/// given response model. +/// +/// * **req** is a proto request model. Most likely it's a result of proto code generation; +/// * **path** is an RPC request path. Should be one of allowlisted stargate query paths; +/// +/// Since stargate query results are JSON-encoded instead of protobuf-encoded, the Res is +/// expected to have a serde::de::DeserializeOwned trait. Why JSON, not proto? See the link: +/// https://github.com/CosmWasm/wasmd/blob/6f6be7880f1caa666b86aaafea625208d70675dc/x/wasm/keeper/query_plugins.go#L360 pub(crate) fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult where Req: prost::Message, @@ -13,6 +22,11 @@ where }) } +/// creates a CosmosMsg::Stargate with given request payload and path. +/// +/// * **req** is a proto request model. Most likely it's a result of proto code generation; +/// * **path** is an RPC request path. See Msg service definitions in neutron modules' proto files +/// for additional info. pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { CosmosMsg::Stargate { type_url: path.to_string(), From 4fa9c69bb6ac4ac7360da0e974a1a7a73ef7671a Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 11 Dec 2023 12:36:00 +0300 Subject: [PATCH 67/77] improve convert_timestamp naming and add description --- packages/neutron-sdk/src/stargate/aux.rs | 3 ++- packages/neutron-sdk/src/stargate/types_dex.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 7de892ed..76957421 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -34,7 +34,8 @@ pub(crate) fn create_stargate_msg(req: Req, path: &str) -> } } -pub(crate) fn convert_timestamp(timestamp: i64) -> TimestampGen { +/// creates a prost_types::Timestamp from a given unix timestamp value in seconds. +pub(crate) fn proto_timestamp_from_i64(timestamp: i64) -> TimestampGen { TimestampGen { seconds: timestamp, nanos: 0, diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index aa574b02..b655f105 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -1,5 +1,5 @@ use crate::bindings::query::{PageRequest, PageResponse}; -use crate::stargate::aux::convert_timestamp; +use crate::stargate::aux::proto_timestamp_from_i64; use crate::stargate::proto_types::neutron::dex::{ DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, @@ -107,7 +107,7 @@ impl From for MsgPlaceLimitOrder { tick_index_in_to_out: v.tick_index_in_to_out, amount_in: v.amount_in, order_type: v.order_type as i32, - expiration_time: v.expiration_time.map(convert_timestamp), + expiration_time: v.expiration_time.map(proto_timestamp_from_i64), max_amount_out: v.max_amount_out.unwrap_or_default(), } } @@ -527,7 +527,7 @@ impl From for QueryEstimatePlaceLimitOrderReques tick_index_in_to_out: v.tick_index_in_to_out, amount_in: v.amount_in, order_type: v.order_type as i32, - expiration_time: v.expiration_time.map(convert_timestamp), + expiration_time: v.expiration_time.map(proto_timestamp_from_i64), max_amount_out: v.max_amount_out.unwrap_or_default(), } } From b3ea9758416c544e4643584e88017df84336262e Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 11 Dec 2023 13:25:56 +0300 Subject: [PATCH 68/77] make stargate helper funcs public --- packages/neutron-sdk/src/stargate/aux.rs | 4 ++-- packages/neutron-sdk/src/stargate/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 76957421..d1ac3583 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -11,7 +11,7 @@ use serde::de::DeserializeOwned; /// Since stargate query results are JSON-encoded instead of protobuf-encoded, the Res is /// expected to have a serde::de::DeserializeOwned trait. Why JSON, not proto? See the link: /// https://github.com/CosmWasm/wasmd/blob/6f6be7880f1caa666b86aaafea625208d70675dc/x/wasm/keeper/query_plugins.go#L360 -pub(crate) fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult +pub fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult where Req: prost::Message, Res: DeserializeOwned, @@ -27,7 +27,7 @@ where /// * **req** is a proto request model. Most likely it's a result of proto code generation; /// * **path** is an RPC request path. See Msg service definitions in neutron modules' proto files /// for additional info. -pub(crate) fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { +pub fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { CosmosMsg::Stargate { type_url: path.to_string(), value: Binary::from(req.encode_to_vec()), diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 4efade73..25c16ef3 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -1,7 +1,7 @@ -pub(crate) mod aux; pub(crate) mod msg_dex; pub(crate) mod query_dex; +pub mod aux; pub mod proto_types; pub mod types_dex; From 7db0a7a2da5dcd9058e1891a4362c4e011f07fad Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 11 Dec 2023 13:26:56 +0300 Subject: [PATCH 69/77] move proto_types stargate's module to a standalone package --- packages/neutron-sdk/src/lib.rs | 1 + .../neutron-sdk/src/{stargate => }/proto_types/NEUTRON_COMMIT | 0 packages/neutron-sdk/src/{stargate => }/proto_types/mod.rs | 0 .../src/{stargate => }/proto_types/neutron.contractmanager.rs | 0 .../{stargate => }/proto_types/neutron.contractmanager.v1.rs | 0 .../src/{stargate => }/proto_types/neutron.cron.rs | 0 .../neutron-sdk/src/{stargate => }/proto_types/neutron.dex.rs | 0 .../src/{stargate => }/proto_types/neutron.feeburner.rs | 0 .../src/{stargate => }/proto_types/neutron.feerefunder.rs | 0 .../{stargate => }/proto_types/neutron.interchainqueries.rs | 0 .../src/{stargate => }/proto_types/neutron.interchaintxs.rs | 0 .../{stargate => }/proto_types/neutron.interchaintxs.v1.rs | 0 .../src/{stargate => }/proto_types/neutron.transfer.rs | 0 .../proto_types/osmosis.tokenfactory.v1beta1.rs | 0 packages/neutron-sdk/src/stargate/mod.rs | 1 - packages/neutron-sdk/src/stargate/msg_dex.rs | 4 ++-- packages/neutron-sdk/src/stargate/query_dex.rs | 4 ++-- packages/neutron-sdk/src/stargate/types_dex.rs | 4 ++-- 18 files changed, 7 insertions(+), 7 deletions(-) rename packages/neutron-sdk/src/{stargate => }/proto_types/NEUTRON_COMMIT (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/mod.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.contractmanager.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.contractmanager.v1.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.cron.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.dex.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.feeburner.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.feerefunder.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.interchainqueries.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.interchaintxs.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.interchaintxs.v1.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/neutron.transfer.rs (100%) rename packages/neutron-sdk/src/{stargate => }/proto_types/osmosis.tokenfactory.v1beta1.rs (100%) diff --git a/packages/neutron-sdk/src/lib.rs b/packages/neutron-sdk/src/lib.rs index a470feeb..c4a0d106 100644 --- a/packages/neutron-sdk/src/lib.rs +++ b/packages/neutron-sdk/src/lib.rs @@ -2,6 +2,7 @@ pub mod bindings; mod errors; pub mod interchain_queries; pub mod interchain_txs; +pub mod proto_types; pub mod query; pub mod stargate; pub mod sudo; diff --git a/packages/neutron-sdk/src/stargate/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/NEUTRON_COMMIT rename to packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT diff --git a/packages/neutron-sdk/src/stargate/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/mod.rs rename to packages/neutron-sdk/src/proto_types/mod.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.rs b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.rs rename to packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.v1.rs b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.contractmanager.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron.contractmanager.v1.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.cron.rs b/packages/neutron-sdk/src/proto_types/neutron.cron.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.cron.rs rename to packages/neutron-sdk/src/proto_types/neutron.cron.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.dex.rs b/packages/neutron-sdk/src/proto_types/neutron.dex.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.dex.rs rename to packages/neutron-sdk/src/proto_types/neutron.dex.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.feeburner.rs b/packages/neutron-sdk/src/proto_types/neutron.feeburner.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.feeburner.rs rename to packages/neutron-sdk/src/proto_types/neutron.feeburner.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.feerefunder.rs b/packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.feerefunder.rs rename to packages/neutron-sdk/src/proto_types/neutron.feerefunder.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.interchainqueries.rs b/packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.interchainqueries.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchainqueries.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.interchaintxs.v1.rs rename to packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/neutron.transfer.rs b/packages/neutron-sdk/src/proto_types/neutron.transfer.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/neutron.transfer.rs rename to packages/neutron-sdk/src/proto_types/neutron.transfer.rs diff --git a/packages/neutron-sdk/src/stargate/proto_types/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/proto_types/osmosis.tokenfactory.v1beta1.rs rename to packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 25c16ef3..5af79905 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -2,7 +2,6 @@ pub(crate) mod msg_dex; pub(crate) mod query_dex; pub mod aux; -pub mod proto_types; pub mod types_dex; pub mod query { diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/msg_dex.rs index b1b12227..f083aa60 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/msg_dex.rs @@ -1,8 +1,8 @@ -use crate::stargate::aux::create_stargate_msg; -use crate::stargate::proto_types::neutron::dex::{ +use crate::proto_types::neutron::dex::{ MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, }; +use crate::stargate::aux::create_stargate_msg; use crate::stargate::types_dex::{ CancelLimitOrderRequest, DepositRequest, MultiHopSwapRequest, PlaceLimitOrderRequest, WithdrawFilledLimitOrderRequest, WithdrawalRequest, diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/query_dex.rs index 843f16a3..2e13c4a8 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/query_dex.rs @@ -1,5 +1,4 @@ -use crate::stargate::aux::make_stargate_query; -use crate::stargate::proto_types::neutron::dex::{ +use crate::proto_types::neutron::dex::{ QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest, QueryAllLimitOrderTrancheUserRequest, QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, QueryAllTickLiquidityRequest, QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest, @@ -8,6 +7,7 @@ use crate::stargate::proto_types::neutron::dex::{ QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest, }; +use crate::stargate::aux::make_stargate_query; use crate::stargate::types_dex::{ AllInactiveLimitOrderTrancheRequest, AllInactiveLimitOrderTrancheResponse, AllLimitOrderTrancheRequest, AllLimitOrderTrancheResponse, AllPoolMetadataRequest, diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index b655f105..918a5ede 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -1,6 +1,5 @@ use crate::bindings::query::{PageRequest, PageResponse}; -use crate::stargate::aux::proto_timestamp_from_i64; -use crate::stargate::proto_types::neutron::dex::{ +use crate::proto_types::neutron::dex::{ DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute, QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest, @@ -11,6 +10,7 @@ use crate::stargate::proto_types::neutron::dex::{ QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest, }; +use crate::stargate::aux::proto_timestamp_from_i64; use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen; use cosmwasm_std::{Coin, Int128, Int64, Uint64}; use schemars::JsonSchema; From 4b37021e1a45b302f5e5f6e12c051379953790e7 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 11 Dec 2023 13:45:40 +0300 Subject: [PATCH 70/77] move dex-related files to a dex submodule in stargate package --- packages/neutron-sdk/src/stargate/README.md | 6 +++--- packages/neutron-sdk/src/stargate/dex/mod.rs | 3 +++ .../src/stargate/{msg_dex.rs => dex/msg.rs} | 2 +- .../stargate/{query_dex.rs => dex/query.rs} | 2 +- .../stargate/{types_dex.rs => dex/types.rs} | 0 packages/neutron-sdk/src/stargate/mod.rs | 21 +------------------ 6 files changed, 9 insertions(+), 25 deletions(-) create mode 100644 packages/neutron-sdk/src/stargate/dex/mod.rs rename packages/neutron-sdk/src/stargate/{msg_dex.rs => dex/msg.rs} (98%) rename packages/neutron-sdk/src/stargate/{query_dex.rs => dex/query.rs} (99%) rename packages/neutron-sdk/src/stargate/{types_dex.rs => dex/types.rs} (100%) diff --git a/packages/neutron-sdk/src/stargate/README.md b/packages/neutron-sdk/src/stargate/README.md index cef92567..62fdb856 100644 --- a/packages/neutron-sdk/src/stargate/README.md +++ b/packages/neutron-sdk/src/stargate/README.md @@ -6,6 +6,6 @@ This package contains list of helpers to interact with Neutron blockchain via St For the `dex` module, there are helpers for all possible messages and queries in the package. The helpers have manually written adapted types for requests and responses instead of proto generated ones because proto-gen works poorly with rust code as the output. -- helpers to construct CosmosMsgs to the dex module are placed in the [msg_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/msg_dex.rs) file; -- helpers to retrieve data from the dex module are placed in the [query_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/query_dex.rs) file; -- different types (e.g. request/response types) are placed in the [types_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/types_dex.rs) file. +- helpers to construct CosmosMsgs to the dex module are placed in the [msg_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/dex/msg.rs) file; +- helpers to retrieve data from the dex module are placed in the [query_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/dex/query.rs) file; +- different types (e.g. request/response types) are placed in the [types_dex.rs](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate/dex/types.rs) file. diff --git a/packages/neutron-sdk/src/stargate/dex/mod.rs b/packages/neutron-sdk/src/stargate/dex/mod.rs new file mode 100644 index 00000000..299b4f33 --- /dev/null +++ b/packages/neutron-sdk/src/stargate/dex/mod.rs @@ -0,0 +1,3 @@ +pub mod msg; +pub mod query; +pub mod types; diff --git a/packages/neutron-sdk/src/stargate/msg_dex.rs b/packages/neutron-sdk/src/stargate/dex/msg.rs similarity index 98% rename from packages/neutron-sdk/src/stargate/msg_dex.rs rename to packages/neutron-sdk/src/stargate/dex/msg.rs index f083aa60..269a07fd 100644 --- a/packages/neutron-sdk/src/stargate/msg_dex.rs +++ b/packages/neutron-sdk/src/stargate/dex/msg.rs @@ -3,7 +3,7 @@ use crate::proto_types::neutron::dex::{ MsgWithdrawFilledLimitOrder, MsgWithdrawal, }; use crate::stargate::aux::create_stargate_msg; -use crate::stargate::types_dex::{ +use crate::stargate::dex::types::{ CancelLimitOrderRequest, DepositRequest, MultiHopSwapRequest, PlaceLimitOrderRequest, WithdrawFilledLimitOrderRequest, WithdrawalRequest, }; diff --git a/packages/neutron-sdk/src/stargate/query_dex.rs b/packages/neutron-sdk/src/stargate/dex/query.rs similarity index 99% rename from packages/neutron-sdk/src/stargate/query_dex.rs rename to packages/neutron-sdk/src/stargate/dex/query.rs index 2e13c4a8..a9b1c2b1 100644 --- a/packages/neutron-sdk/src/stargate/query_dex.rs +++ b/packages/neutron-sdk/src/stargate/dex/query.rs @@ -8,7 +8,7 @@ use crate::proto_types::neutron::dex::{ QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest, }; use crate::stargate::aux::make_stargate_query; -use crate::stargate::types_dex::{ +use crate::stargate::dex::types::{ AllInactiveLimitOrderTrancheRequest, AllInactiveLimitOrderTrancheResponse, AllLimitOrderTrancheRequest, AllLimitOrderTrancheResponse, AllPoolMetadataRequest, AllPoolMetadataResponse, AllPoolReservesRequest, AllPoolReservesResponse, diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/dex/types.rs similarity index 100% rename from packages/neutron-sdk/src/stargate/types_dex.rs rename to packages/neutron-sdk/src/stargate/dex/types.rs diff --git a/packages/neutron-sdk/src/stargate/mod.rs b/packages/neutron-sdk/src/stargate/mod.rs index 5af79905..0ba58e2a 100644 --- a/packages/neutron-sdk/src/stargate/mod.rs +++ b/packages/neutron-sdk/src/stargate/mod.rs @@ -1,21 +1,2 @@ -pub(crate) mod msg_dex; -pub(crate) mod query_dex; - pub mod aux; -pub mod types_dex; - -pub mod query { - pub mod neutron { - pub mod dex { - pub use crate::stargate::query_dex::*; - } - } -} - -pub mod msg { - pub mod neutron { - pub mod dex { - pub use crate::stargate::msg_dex::*; - } - } -} +pub mod dex; From 520022fad4fc7e78569ec87e81043346f5125051 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Wed, 13 Dec 2023 14:38:32 +0300 Subject: [PATCH 71/77] cover dex stargate helpers with comments --- packages/neutron-sdk/src/stargate/dex/msg.rs | 14 ++++++ .../neutron-sdk/src/stargate/dex/query.rs | 16 +++++++ .../neutron-sdk/src/stargate/dex/types.rs | 46 ++++++++++++++++++- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/dex/msg.rs b/packages/neutron-sdk/src/stargate/dex/msg.rs index 269a07fd..bc3086fc 100644 --- a/packages/neutron-sdk/src/stargate/dex/msg.rs +++ b/packages/neutron-sdk/src/stargate/dex/msg.rs @@ -16,18 +16,25 @@ const WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgWithdrawFill const CANCEL_LIMIT_ORDER_MSG_PATH: &str = "/neutron.dex.MsgCancelLimitOrder"; const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; +/// Provides liquidity to a specific trading pair by depositing tokens at a specific price into one +/// or both sides of the pair in “a liquidity pool”. pub fn msg_deposit(req: DepositRequest) -> CosmosMsg { create_stargate_msg(MsgDeposit::from(req), DEPOSIT_MSG_PATH) } +/// Redeems PoolShares for the user’s pro-rata portion of tokens within a liquidity pool. When +/// withdrawing from a pool they will receive token_a and token_b in the same ratio as what is +/// currently present in the pool. pub fn msg_withdrawal(req: WithdrawalRequest) -> CosmosMsg { create_stargate_msg(MsgWithdrawal::from(req), WITHDRAWAL_MSG_PATH) } +/// Provides new liquidity to the dex that can be swapped through by other traders. pub fn msg_place_limit_order(req: PlaceLimitOrderRequest) -> CosmosMsg { create_stargate_msg(MsgPlaceLimitOrder::from(req), PLACE_LIMIT_ORDER_MSG_PATH) } +/// Withdraws all available credits from an either partially or entirely fulfilled limit order. pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> CosmosMsg { create_stargate_msg( MsgWithdrawFilledLimitOrder::from(req), @@ -35,10 +42,17 @@ pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> ) } +/// Cancels a standard taker limit order (Good-til-cancelled | Good-til-time) if it has not been +/// completely filled. Once a limit order is canceled any remaining “TokenIn” liquidity is returned +/// to the user. +/// +/// NOTE: Cancelling a partially filled limit order does not withdraw the traded portion. A separate +/// call must be made to `WithdrawFilledLimitOrder` to withdraw any proceeds from the limit order. pub fn msg_cancel_limit_order(req: CancelLimitOrderRequest) -> CosmosMsg { create_stargate_msg(MsgCancelLimitOrder::from(req), CANCEL_LIMIT_ORDER_MSG_PATH) } +/// Swaps by routing through a series of pools to achieve better prices. pub fn msg_multi_hop_swap(req: MultiHopSwapRequest) -> CosmosMsg { create_stargate_msg(MsgMultiHopSwap::from(req), MULTI_HOP_SWAP_MSG_PATH) } diff --git a/packages/neutron-sdk/src/stargate/dex/query.rs b/packages/neutron-sdk/src/stargate/dex/query.rs index a9b1c2b1..a32e7f59 100644 --- a/packages/neutron-sdk/src/stargate/dex/query.rs +++ b/packages/neutron-sdk/src/stargate/dex/query.rs @@ -46,10 +46,12 @@ const POOL_BY_ID_QUERY_PATH: &str = "/neutron.dex.Query/PoolByID"; const POOL_METADATA_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadata"; const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; +/// Queries the parameters of the module. pub fn get_params(deps: Deps, req: ParamsRequest) -> StdResult { make_stargate_query(deps, QueryParamsRequest::from(req), PARAMS_QUERY_PATH) } +/// Retrieves a `LimitOrderTrancheUser` by user address and tranche key. pub fn get_limit_order_tranche_user( deps: Deps, req: LimitOrderTrancheUserRequest, @@ -61,6 +63,7 @@ pub fn get_limit_order_tranche_user( ) } +/// Retrieves a list of `LimitOrderTrancheUser` items. pub fn get_limit_order_tranche_user_all( deps: Deps, req: LimitOrderTrancheUserAllRequest, @@ -72,6 +75,7 @@ pub fn get_limit_order_tranche_user_all( ) } +/// Retrieves a list of `LimitOrderTrancheUser` items by user address. pub fn get_limit_order_tranche_user_all_by_address( deps: Deps, req: AllUserLimitOrdersRequest, @@ -83,6 +87,7 @@ pub fn get_limit_order_tranche_user_all_by_address( ) } +/// Retrieves a `LimitOrderTranche` by index. pub fn get_limit_order_tranche( deps: Deps, req: GetLimitOrderTrancheRequest, @@ -94,6 +99,7 @@ pub fn get_limit_order_tranche( ) } +/// Retrieves a list of `LimitOrderTranche` items for a given pair_id / token_in combination. pub fn get_limit_order_tranche_all( deps: Deps, req: AllLimitOrderTrancheRequest, @@ -105,6 +111,7 @@ pub fn get_limit_order_tranche_all( ) } +/// Retrieves a list of `DepositRecord` items by user address. pub fn get_user_deposits_all( deps: Deps, req: AllUserDepositsRequest, @@ -116,6 +123,7 @@ pub fn get_user_deposits_all( ) } +/// Retrieves a list of `TickLiquidity` items for a given pair_id / token_in combination. pub fn get_tick_liquidity_all( deps: Deps, req: AllTickLiquidityRequest, @@ -127,6 +135,7 @@ pub fn get_tick_liquidity_all( ) } +/// Retrieves an inactive `LimitOrderTranche` by index. pub fn get_inactive_limit_order_tranche( deps: Deps, req: GetInactiveLimitOrderTrancheRequest, @@ -138,6 +147,7 @@ pub fn get_inactive_limit_order_tranche( ) } +/// Retrieves a list of inactive `LimitOrderTranche` items. pub fn get_inactive_limit_order_tranche_all( deps: Deps, req: AllInactiveLimitOrderTrancheRequest, @@ -149,6 +159,7 @@ pub fn get_inactive_limit_order_tranche_all( ) } +/// Retrieves a list of `PoolReserves` items for a given pair_id / token_in combination. pub fn get_pool_reserves_all( deps: Deps, req: AllPoolReservesRequest, @@ -160,6 +171,7 @@ pub fn get_pool_reserves_all( ) } +/// Retrieves a `PoolReserves` by index. pub fn get_pool_reserves( deps: Deps, req: GetPoolReservesRequest, @@ -171,6 +183,7 @@ pub fn get_pool_reserves( ) } +/// Queries the simulated result of a multihop swap. pub fn get_estimate_multi_hop_swap( deps: Deps, req: EstimateMultiHopSwapRequest, @@ -197,10 +210,12 @@ pub fn get_pool(deps: Deps, req: PoolRequest) -> StdResult { make_stargate_query(deps, QueryPoolRequest::from(req), POOL_QUERY_PATH) } +/// Queries a pool by ID. pub fn get_pool_by_id(deps: Deps, req: PoolByIdRequest) -> StdResult { make_stargate_query(deps, QueryPoolByIdRequest::from(req), POOL_BY_ID_QUERY_PATH) } +/// Queries a `PoolMetadata` by ID. pub fn get_pool_metadata( deps: Deps, req: GetPoolMetadataRequest, @@ -212,6 +227,7 @@ pub fn get_pool_metadata( ) } +/// Queries a list of `PoolMetadata` items. pub fn get_pool_metadata_all( deps: Deps, req: AllPoolMetadataRequest, diff --git a/packages/neutron-sdk/src/stargate/dex/types.rs b/packages/neutron-sdk/src/stargate/dex/types.rs index 918a5ede..51b3077b 100644 --- a/packages/neutron-sdk/src/stargate/dex/types.rs +++ b/packages/neutron-sdk/src/stargate/dex/types.rs @@ -28,14 +28,23 @@ pub const JIT_LIMIT_ORDER_TYPE_EXP_TIMESTAMP: i64 = 0; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct DepositRequest { + /// The account from which deposit Tokens will be debited. pub sender: String, + /// The account to which PoolShares will be issued. pub receiver: String, + /// Denom for one side of the deposit. pub token_a: String, + /// Denom for the opposing side of the deposit. pub token_b: String, + /// Amounts of token_a to deposit. pub amounts_a: Vec, + /// Amounts of token_b to deposit. pub amounts_b: Vec, + /// Tick indexes to deposit at defined in terms of token_a to token_b (i.e. token_a is on the left). pub tick_indexes_a_to_b: Vec, + /// Fees to use for each deposit. pub fees: Vec, + /// Additional deposit options. pub options: Vec, } @@ -59,12 +68,20 @@ impl From for MsgDeposit { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct WithdrawalRequest { + /// The account from which the PoolShares are removed. pub sender: String, + /// The account to which the tokens are credited. pub receiver: String, + /// Denom for one side of the deposit. pub token_a: String, + /// Denom for the opposing side of the deposit. pub token_b: String, + /// Amount of shares to remove from each pool. pub shares_to_remove: Vec, + /// Tick indexes of the target LiquidityPools defined in terms of tokan_a to token_b (i.e. + /// token_a is on the left). pub tick_indexes_a_to_b: Vec, + /// Fee for the target LiquidityPools. pub fees: Vec, } @@ -86,13 +103,22 @@ impl From for MsgWithdrawal { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct PlaceLimitOrderRequest { + /// Account from which token_in is debited. pub sender: String, + /// Account to which token_out is credited or that will be allowed to withdraw or cancel a + /// maker order. pub receiver: String, + /// Token being “sold”. pub token_in: String, + /// Token being “bought”. pub token_out: String, + /// Limit tick for a limit order, specified in terms of token_in to token_out. pub tick_index_in_to_out: i64, + /// Amount of TokenIn to be traded. pub amount_in: String, + /// Type of limit order to be used. pub order_type: LimitOrderType, + /// Expiration time for order. Only valid for GoodTilTime limit orders. pub expiration_time: Option, pub max_amount_out: Option, } @@ -117,7 +143,9 @@ impl From for MsgPlaceLimitOrder { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct WithdrawFilledLimitOrderRequest { + /// Account which controls the limit order and to which proceeds are credited. pub sender: String, + /// Tranche key for the target limit order. pub tranche_key: String, } @@ -134,7 +162,9 @@ impl From for MsgWithdrawFilledLimitOrder { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct CancelLimitOrderRequest { + /// Account which controls the limit order and to which any untraded amount is credited. pub sender: String, + /// Tranche key for the target limit order. pub tranche_key: String, } @@ -151,11 +181,20 @@ impl From for MsgCancelLimitOrder { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct MultiHopSwapRequest { + /// Account from which token_in is debited. pub sender: String, + /// Account to which token_out is credited. pub receiver: String, + /// Array of possible routes. E.g. [[“token_a”, “token_c”, “token_d”, “token_b”]]. The complete + /// amount of specified by `amount_in` will always be used. If there is insufficient liquidity + /// in a route to swap 100% of the `amount_in` the route will fail. The first route that does + /// not run out of liquidity, hit the `exit_limit_price` or return an error will be used. pub routes: Vec>, + /// Amount of token_in to swap. pub amount_in: String, + /// Minimum price that that must be satisfied for a route to succeed. pub exit_limit_price: String, + /// If true all routes are run and the route with the best price is used. pub pick_best_route: bool, } @@ -343,7 +382,7 @@ pub struct AllTickLiquidityRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct AllTickLiquidityResponse { - pub tick_liquidity: Vec, + pub tick_liquidity: Vec, pub pagination: Option, } @@ -613,6 +652,8 @@ impl From for QueryAllPoolMetadataRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct DepositOptions { + /// Autoswap provides a mechanism for users to deposit the entirety of their specified deposit + /// amounts by paying a small fee. By default the `autoswap` option is enabled. pub disable_autoswap: bool, } @@ -685,6 +726,7 @@ pub struct LimitOrderTranche { pub reserves_taker_denom: Int128, pub total_maker_denom: Int128, pub total_taker_denom: Int128, + /// unix timestamp in seconds; #[serde(deserialize_with = "deserialize_expiration_time")] pub expiration_time: Option, /// a decimal with precision equal to 26 @@ -709,7 +751,7 @@ pub struct PairID { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -pub enum Liquidity { +pub enum TickLiquidity { PoolReserves(PoolReserves), LimitOrderTranche(LimitOrderTranche), } From 89b04ff8a4454a08722e42f1c82bb93a245cb110 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 15 Dec 2023 12:51:52 +0300 Subject: [PATCH 72/77] add missing stargate feature for cosmwasm-sdt import --- packages/neutron-sdk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neutron-sdk/Cargo.toml b/packages/neutron-sdk/Cargo.toml index 36d63798..49e30845 100644 --- a/packages/neutron-sdk/Cargo.toml +++ b/packages/neutron-sdk/Cargo.toml @@ -9,7 +9,7 @@ homepage = "https://neutron.org" readme = "README.md" [dependencies] -cosmwasm-std = { workspace = true } +cosmwasm-std = { workspace = true, features = ["stargate"] } cosmos-sdk-proto = { workspace = true } serde = { workspace = true } schemars = { workspace = true } From 10e0aced17d9242161379ab3aea88df7a7763c21 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 15 Dec 2023 12:52:02 +0300 Subject: [PATCH 73/77] generate schema --- packages/neutron-sdk/schema/neutron_msg.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index 32a5d4a1..a9acef08 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -14,8 +14,7 @@ "type": "object", "required": [ "connection_id", - "interchain_account_id", - "register_fee" + "interchain_account_id" ], "properties": { "connection_id": { @@ -28,7 +27,10 @@ }, "register_fee": { "description": "*register_fee** is a fees required to be payed to register interchain account", - "type": "array", + "type": [ + "array", + "null" + ], "items": { "$ref": "#/definitions/Coin" } From cbb934d4e6142910f5f13fd19c3d43b654a5b7a7 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 15 Dec 2023 12:52:32 +0300 Subject: [PATCH 74/77] add/polish stargate queries desc for dex module --- packages/neutron-sdk/src/stargate/dex/query.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/dex/query.rs b/packages/neutron-sdk/src/stargate/dex/query.rs index a32e7f59..7610c77e 100644 --- a/packages/neutron-sdk/src/stargate/dex/query.rs +++ b/packages/neutron-sdk/src/stargate/dex/query.rs @@ -87,7 +87,7 @@ pub fn get_limit_order_tranche_user_all_by_address( ) } -/// Retrieves a `LimitOrderTranche` by index. +/// Retrieves a `LimitOrderTranche` by a tranche's key (pair_id + token_in + tick_index + tranche_key). pub fn get_limit_order_tranche( deps: Deps, req: GetLimitOrderTrancheRequest, @@ -171,7 +171,7 @@ pub fn get_pool_reserves_all( ) } -/// Retrieves a `PoolReserves` by index. +/// Retrieves a `PoolReserves` by pool reserves key (pair_id + token_in + tick_index + fee). pub fn get_pool_reserves( deps: Deps, req: GetPoolReservesRequest, @@ -195,6 +195,7 @@ pub fn get_estimate_multi_hop_swap( ) } +/// Queries the simulated result of a limit order placement. pub fn get_estimate_place_limit_order( deps: Deps, req: EstimatePlaceLimitOrderRequest, @@ -206,6 +207,7 @@ pub fn get_estimate_place_limit_order( ) } +/// Queries a pool by pair, tick and fee. pub fn get_pool(deps: Deps, req: PoolRequest) -> StdResult { make_stargate_query(deps, QueryPoolRequest::from(req), POOL_QUERY_PATH) } From ac6ec2fd5fb44831dfe7eb781af91edbac920a59 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Wed, 20 Dec 2023 14:30:04 +0300 Subject: [PATCH 75/77] swap req and path params in make_stargate_query and create_stargate_msg --- packages/neutron-sdk/src/stargate/aux.rs | 4 +-- packages/neutron-sdk/src/stargate/dex/msg.rs | 12 +++---- .../neutron-sdk/src/stargate/dex/query.rs | 36 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index d1ac3583..7d8ee087 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -11,7 +11,7 @@ use serde::de::DeserializeOwned; /// Since stargate query results are JSON-encoded instead of protobuf-encoded, the Res is /// expected to have a serde::de::DeserializeOwned trait. Why JSON, not proto? See the link: /// https://github.com/CosmWasm/wasmd/blob/6f6be7880f1caa666b86aaafea625208d70675dc/x/wasm/keeper/query_plugins.go#L360 -pub fn make_stargate_query(deps: Deps, req: Req, path: &str) -> StdResult +pub fn make_stargate_query(deps: Deps, path: &str, req: Req) -> StdResult where Req: prost::Message, Res: DeserializeOwned, @@ -27,7 +27,7 @@ where /// * **req** is a proto request model. Most likely it's a result of proto code generation; /// * **path** is an RPC request path. See Msg service definitions in neutron modules' proto files /// for additional info. -pub fn create_stargate_msg(req: Req, path: &str) -> CosmosMsg { +pub fn create_stargate_msg(path: &str, req: Req) -> CosmosMsg { CosmosMsg::Stargate { type_url: path.to_string(), value: Binary::from(req.encode_to_vec()), diff --git a/packages/neutron-sdk/src/stargate/dex/msg.rs b/packages/neutron-sdk/src/stargate/dex/msg.rs index bc3086fc..d9f02f30 100644 --- a/packages/neutron-sdk/src/stargate/dex/msg.rs +++ b/packages/neutron-sdk/src/stargate/dex/msg.rs @@ -19,26 +19,26 @@ const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; /// Provides liquidity to a specific trading pair by depositing tokens at a specific price into one /// or both sides of the pair in “a liquidity pool”. pub fn msg_deposit(req: DepositRequest) -> CosmosMsg { - create_stargate_msg(MsgDeposit::from(req), DEPOSIT_MSG_PATH) + create_stargate_msg(DEPOSIT_MSG_PATH, MsgDeposit::from(req)) } /// Redeems PoolShares for the user’s pro-rata portion of tokens within a liquidity pool. When /// withdrawing from a pool they will receive token_a and token_b in the same ratio as what is /// currently present in the pool. pub fn msg_withdrawal(req: WithdrawalRequest) -> CosmosMsg { - create_stargate_msg(MsgWithdrawal::from(req), WITHDRAWAL_MSG_PATH) + create_stargate_msg(WITHDRAWAL_MSG_PATH, MsgWithdrawal::from(req)) } /// Provides new liquidity to the dex that can be swapped through by other traders. pub fn msg_place_limit_order(req: PlaceLimitOrderRequest) -> CosmosMsg { - create_stargate_msg(MsgPlaceLimitOrder::from(req), PLACE_LIMIT_ORDER_MSG_PATH) + create_stargate_msg(PLACE_LIMIT_ORDER_MSG_PATH, MsgPlaceLimitOrder::from(req)) } /// Withdraws all available credits from an either partially or entirely fulfilled limit order. pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> CosmosMsg { create_stargate_msg( - MsgWithdrawFilledLimitOrder::from(req), WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH, + MsgWithdrawFilledLimitOrder::from(req), ) } @@ -49,10 +49,10 @@ pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> /// NOTE: Cancelling a partially filled limit order does not withdraw the traded portion. A separate /// call must be made to `WithdrawFilledLimitOrder` to withdraw any proceeds from the limit order. pub fn msg_cancel_limit_order(req: CancelLimitOrderRequest) -> CosmosMsg { - create_stargate_msg(MsgCancelLimitOrder::from(req), CANCEL_LIMIT_ORDER_MSG_PATH) + create_stargate_msg(CANCEL_LIMIT_ORDER_MSG_PATH, MsgCancelLimitOrder::from(req)) } /// Swaps by routing through a series of pools to achieve better prices. pub fn msg_multi_hop_swap(req: MultiHopSwapRequest) -> CosmosMsg { - create_stargate_msg(MsgMultiHopSwap::from(req), MULTI_HOP_SWAP_MSG_PATH) + create_stargate_msg(MULTI_HOP_SWAP_MSG_PATH, MsgMultiHopSwap::from(req)) } diff --git a/packages/neutron-sdk/src/stargate/dex/query.rs b/packages/neutron-sdk/src/stargate/dex/query.rs index 7610c77e..c0c30b08 100644 --- a/packages/neutron-sdk/src/stargate/dex/query.rs +++ b/packages/neutron-sdk/src/stargate/dex/query.rs @@ -48,7 +48,7 @@ const POOL_METADATA_ALL_QUERY_PATH: &str = "/neutron.dex.Query/PoolMetadataAll"; /// Queries the parameters of the module. pub fn get_params(deps: Deps, req: ParamsRequest) -> StdResult { - make_stargate_query(deps, QueryParamsRequest::from(req), PARAMS_QUERY_PATH) + make_stargate_query(deps, PARAMS_QUERY_PATH, QueryParamsRequest::from(req)) } /// Retrieves a `LimitOrderTrancheUser` by user address and tranche key. @@ -58,8 +58,8 @@ pub fn get_limit_order_tranche_user( ) -> StdResult { make_stargate_query( deps, - QueryGetLimitOrderTrancheUserRequest::from(req), LIMIT_ORDER_TRANCHE_USER_QUERY_PATH, + QueryGetLimitOrderTrancheUserRequest::from(req), ) } @@ -70,8 +70,8 @@ pub fn get_limit_order_tranche_user_all( ) -> StdResult { make_stargate_query( deps, - QueryAllLimitOrderTrancheUserRequest::from(req), LIMIT_ORDER_TRANCHE_USER_ALL_QUERY_PATH, + QueryAllLimitOrderTrancheUserRequest::from(req), ) } @@ -82,8 +82,8 @@ pub fn get_limit_order_tranche_user_all_by_address( ) -> StdResult { make_stargate_query( deps, - QueryAllUserLimitOrdersRequest::from(req), LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH, + QueryAllUserLimitOrdersRequest::from(req), ) } @@ -94,8 +94,8 @@ pub fn get_limit_order_tranche( ) -> StdResult { make_stargate_query( deps, - QueryGetLimitOrderTrancheRequest::from(req), LIMIT_ORDER_TRANCHE_QUERY_PATH, + QueryGetLimitOrderTrancheRequest::from(req), ) } @@ -106,8 +106,8 @@ pub fn get_limit_order_tranche_all( ) -> StdResult { make_stargate_query( deps, - QueryAllLimitOrderTrancheRequest::from(req), LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, + QueryAllLimitOrderTrancheRequest::from(req), ) } @@ -118,8 +118,8 @@ pub fn get_user_deposits_all( ) -> StdResult { make_stargate_query( deps, - QueryAllUserDepositsRequest::from(req), USER_DEPOSITS_ALL_QUERY_PATH, + QueryAllUserDepositsRequest::from(req), ) } @@ -130,8 +130,8 @@ pub fn get_tick_liquidity_all( ) -> StdResult { make_stargate_query( deps, - QueryAllTickLiquidityRequest::from(req), TICK_LIQUIDITY_ALL_QUERY_PATH, + QueryAllTickLiquidityRequest::from(req), ) } @@ -142,8 +142,8 @@ pub fn get_inactive_limit_order_tranche( ) -> StdResult { make_stargate_query( deps, - QueryGetInactiveLimitOrderTrancheRequest::from(req), INACTIVE_LIMIT_ORDER_TRANCHE_QUERY_PATH, + QueryGetInactiveLimitOrderTrancheRequest::from(req), ) } @@ -154,8 +154,8 @@ pub fn get_inactive_limit_order_tranche_all( ) -> StdResult { make_stargate_query( deps, - QueryAllInactiveLimitOrderTrancheRequest::from(req), INACTIVE_LIMIT_ORDER_TRANCHE_ALL_QUERY_PATH, + QueryAllInactiveLimitOrderTrancheRequest::from(req), ) } @@ -166,8 +166,8 @@ pub fn get_pool_reserves_all( ) -> StdResult { make_stargate_query( deps, - QueryAllPoolReservesRequest::from(req), POOL_RESERVES_ALL_QUERY_PATH, + QueryAllPoolReservesRequest::from(req), ) } @@ -178,8 +178,8 @@ pub fn get_pool_reserves( ) -> StdResult { make_stargate_query( deps, - QueryGetPoolReservesRequest::from(req), POOL_RESERVES_QUERY_PATH, + QueryGetPoolReservesRequest::from(req), ) } @@ -190,8 +190,8 @@ pub fn get_estimate_multi_hop_swap( ) -> StdResult { make_stargate_query( deps, - QueryEstimateMultiHopSwapRequest::from(req), ESTIMATE_MULTI_HOP_SWAP_QUERY_PATH, + QueryEstimateMultiHopSwapRequest::from(req), ) } @@ -202,19 +202,19 @@ pub fn get_estimate_place_limit_order( ) -> StdResult { make_stargate_query( deps, - QueryEstimatePlaceLimitOrderRequest::from(req), ESTIMATE_PLACE_LIMIT_ORDER_QUERY_PATH, + QueryEstimatePlaceLimitOrderRequest::from(req), ) } /// Queries a pool by pair, tick and fee. pub fn get_pool(deps: Deps, req: PoolRequest) -> StdResult { - make_stargate_query(deps, QueryPoolRequest::from(req), POOL_QUERY_PATH) + make_stargate_query(deps, POOL_QUERY_PATH, QueryPoolRequest::from(req)) } /// Queries a pool by ID. pub fn get_pool_by_id(deps: Deps, req: PoolByIdRequest) -> StdResult { - make_stargate_query(deps, QueryPoolByIdRequest::from(req), POOL_BY_ID_QUERY_PATH) + make_stargate_query(deps, POOL_BY_ID_QUERY_PATH, QueryPoolByIdRequest::from(req)) } /// Queries a `PoolMetadata` by ID. @@ -224,8 +224,8 @@ pub fn get_pool_metadata( ) -> StdResult { make_stargate_query( deps, - QueryGetPoolMetadataRequest::from(req), POOL_METADATA_QUERY_PATH, + QueryGetPoolMetadataRequest::from(req), ) } @@ -236,7 +236,7 @@ pub fn get_pool_metadata_all( ) -> StdResult { make_stargate_query( deps, - QueryAllPoolMetadataRequest::from(req), POOL_METADATA_ALL_QUERY_PATH, + QueryAllPoolMetadataRequest::from(req), ) } From 98f51ec29108359b97028dc11a459c8149021749 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Wed, 20 Dec 2023 14:59:20 +0300 Subject: [PATCH 76/77] parametrize stargate msg helpers with CosmosMsg --- packages/neutron-sdk/src/stargate/aux.rs | 4 ++-- packages/neutron-sdk/src/stargate/dex/msg.rs | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/aux.rs b/packages/neutron-sdk/src/stargate/aux.rs index 7d8ee087..20a4bdf5 100644 --- a/packages/neutron-sdk/src/stargate/aux.rs +++ b/packages/neutron-sdk/src/stargate/aux.rs @@ -27,8 +27,8 @@ where /// * **req** is a proto request model. Most likely it's a result of proto code generation; /// * **path** is an RPC request path. See Msg service definitions in neutron modules' proto files /// for additional info. -pub fn create_stargate_msg(path: &str, req: Req) -> CosmosMsg { - CosmosMsg::Stargate { +pub fn create_stargate_msg(path: &str, req: Req) -> CosmosMsg { + CosmosMsg::Stargate:: { type_url: path.to_string(), value: Binary::from(req.encode_to_vec()), } diff --git a/packages/neutron-sdk/src/stargate/dex/msg.rs b/packages/neutron-sdk/src/stargate/dex/msg.rs index d9f02f30..bd321445 100644 --- a/packages/neutron-sdk/src/stargate/dex/msg.rs +++ b/packages/neutron-sdk/src/stargate/dex/msg.rs @@ -1,3 +1,4 @@ +use crate::bindings::msg::NeutronMsg; use crate::proto_types::neutron::dex::{ MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap, MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, @@ -18,24 +19,26 @@ const MULTI_HOP_SWAP_MSG_PATH: &str = "/neutron.dex.MsgMultiHopSwap"; /// Provides liquidity to a specific trading pair by depositing tokens at a specific price into one /// or both sides of the pair in “a liquidity pool”. -pub fn msg_deposit(req: DepositRequest) -> CosmosMsg { +pub fn msg_deposit(req: DepositRequest) -> CosmosMsg { create_stargate_msg(DEPOSIT_MSG_PATH, MsgDeposit::from(req)) } /// Redeems PoolShares for the user’s pro-rata portion of tokens within a liquidity pool. When /// withdrawing from a pool they will receive token_a and token_b in the same ratio as what is /// currently present in the pool. -pub fn msg_withdrawal(req: WithdrawalRequest) -> CosmosMsg { +pub fn msg_withdrawal(req: WithdrawalRequest) -> CosmosMsg { create_stargate_msg(WITHDRAWAL_MSG_PATH, MsgWithdrawal::from(req)) } /// Provides new liquidity to the dex that can be swapped through by other traders. -pub fn msg_place_limit_order(req: PlaceLimitOrderRequest) -> CosmosMsg { +pub fn msg_place_limit_order(req: PlaceLimitOrderRequest) -> CosmosMsg { create_stargate_msg(PLACE_LIMIT_ORDER_MSG_PATH, MsgPlaceLimitOrder::from(req)) } /// Withdraws all available credits from an either partially or entirely fulfilled limit order. -pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> CosmosMsg { +pub fn msg_withdraw_filled_limit_order( + req: WithdrawFilledLimitOrderRequest, +) -> CosmosMsg { create_stargate_msg( WITHDRAW_FILLED_LIMIT_ORDER_MSG_PATH, MsgWithdrawFilledLimitOrder::from(req), @@ -48,11 +51,11 @@ pub fn msg_withdraw_filled_limit_order(req: WithdrawFilledLimitOrderRequest) -> /// /// NOTE: Cancelling a partially filled limit order does not withdraw the traded portion. A separate /// call must be made to `WithdrawFilledLimitOrder` to withdraw any proceeds from the limit order. -pub fn msg_cancel_limit_order(req: CancelLimitOrderRequest) -> CosmosMsg { +pub fn msg_cancel_limit_order(req: CancelLimitOrderRequest) -> CosmosMsg { create_stargate_msg(CANCEL_LIMIT_ORDER_MSG_PATH, MsgCancelLimitOrder::from(req)) } /// Swaps by routing through a series of pools to achieve better prices. -pub fn msg_multi_hop_swap(req: MultiHopSwapRequest) -> CosmosMsg { +pub fn msg_multi_hop_swap(req: MultiHopSwapRequest) -> CosmosMsg { create_stargate_msg(MULTI_HOP_SWAP_MSG_PATH, MsgMultiHopSwap::from(req)) } From 9d91a002030c59bb68964074f2fc55eda3614b4a Mon Sep 17 00:00:00 2001 From: Neutron Node User Date: Wed, 20 Dec 2023 14:53:27 +0000 Subject: [PATCH 77/77] regenerate proto against reformat proto neutron branch --- .../src/proto_types/NEUTRON_COMMIT | 2 +- packages/neutron-sdk/src/proto_types/mod.rs | 1 - .../proto_types/neutron.contractmanager.rs | 3 +- .../src/proto_types/neutron.dex.rs | 117 +++++++++--------- .../src/proto_types/neutron.interchaintxs.rs | 50 -------- .../proto_types/neutron.interchaintxs.v1.rs | 50 +++++++- .../osmosis.tokenfactory.v1beta1.rs | 3 +- 7 files changed, 115 insertions(+), 111 deletions(-) delete mode 100644 packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs diff --git a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT index 40916b27..9c2c8938 100644 --- a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT +++ b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT @@ -1 +1 @@ -5845ebddc3f85802fd35661f78efd2c7b61e4724 \ No newline at end of file +60b7d38358efb2f8e45e25ee4db8e19a6462dd9e \ No newline at end of file diff --git a/packages/neutron-sdk/src/proto_types/mod.rs b/packages/neutron-sdk/src/proto_types/mod.rs index 0f4a01c7..4b65755c 100644 --- a/packages/neutron-sdk/src/proto_types/mod.rs +++ b/packages/neutron-sdk/src/proto_types/mod.rs @@ -4,7 +4,6 @@ pub mod neutron { } pub mod interchaintxs { - include!("neutron.interchaintxs.rs"); pub mod v1 { include!("neutron.interchaintxs.v1.rs"); } diff --git a/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs index 444e6fa7..6be30075 100644 --- a/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.contractmanager.rs @@ -1,7 +1,8 @@ // @generated /// Failure message contains information about ACK failures and can be used to /// replay ACK in case of requirement. -/// Note that Failure means that sudo handler to cosmwasm contract failed for some reason +/// Note that Failure means that sudo handler to cosmwasm contract failed for +/// some reason #[derive(Clone, PartialEq, ::prost::Message)] pub struct Failure { /// Address of the failed contract diff --git a/packages/neutron-sdk/src/proto_types/neutron.dex.rs b/packages/neutron-sdk/src/proto_types/neutron.dex.rs index b50edc4c..09ddf6db 100644 --- a/packages/neutron-sdk/src/proto_types/neutron.dex.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.dex.rs @@ -21,6 +21,45 @@ pub struct DepositRecord { #[prost(uint64, tag = "6")] pub fee: u64, } +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TradePairId { + #[prost(string, tag = "2")] + pub maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub taker_denom: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderTrancheKey { + #[prost(message, optional, tag = "1")] + pub trade_pair_id: ::core::option::Option, + #[prost(int64, tag = "2")] + pub tick_index_taker_to_maker: i64, + #[prost(string, tag = "3")] + pub tranche_key: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LimitOrderTranche { + #[prost(message, optional, tag = "1")] + pub key: ::core::option::Option, + #[prost(string, tag = "2")] + pub reserves_maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub reserves_taker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub total_maker_denom: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub total_taker_denom: ::prost::alloc::string::String, + /// expiration_time is represented as an RFC 3339 formatted date. + /// LimitOrders with expiration_time set are valid as long as blockTime <= expiration_time. + /// JIT orders also use expiration_time to handle deletion, but represent a special case. + /// All JIT orders have an expiration_time of 0001-01-01T00:00:00Z, and an exception is made to + /// still treat these orders as live. Order deletion still functions the + /// same, and the orders will be deleted at the end of the block. + #[prost(message, optional, tag = "6")] + pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(string, tag = "7")] + pub price_taker_to_maker: ::prost::alloc::string::String, +} /// Params defines the parameters for the module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -30,13 +69,6 @@ pub struct Params { pub max_true_taker_spread: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TradePairId { - #[prost(string, tag = "2")] - pub maker_denom: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub taker_denom: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositOptions { #[prost(bool, tag = "1")] pub disable_autoswap: bool, @@ -118,8 +150,9 @@ pub struct MsgPlaceLimitOrderResponse { #[prost(message, optional, tag = "2")] pub coin_in: ::core::option::Option, /// Total amount of coin received from the taker portion of the limit order - /// This is the amount of coin immediately available in the users account after executing the - /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + /// This is the amount of coin immediately available in the users account after + /// executing the limit order. It does not include any future proceeds from the + /// maker portion which will have withdrawn in the future #[prost(message, optional, tag = "3")] pub taker_coin_out: ::core::option::Option, } @@ -158,8 +191,8 @@ pub struct MsgMultiHopSwap { pub amount_in: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, - /// If pickBestRoute == true then all routes are run and the route with the best price is chosen - /// otherwise, the first succesful route is used. + /// If pickBestRoute == true then all routes are run and the route with the + /// best price is chosen otherwise, the first succesful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } @@ -227,35 +260,15 @@ pub struct LimitOrderTrancheUser { pub order_type: i32, } #[derive(Clone, PartialEq, ::prost::Message)] -pub struct LimitOrderTrancheKey { - #[prost(message, optional, tag = "1")] - pub trade_pair_id: ::core::option::Option, +pub struct PoolMetadata { + #[prost(uint64, tag = "1")] + pub id: u64, #[prost(int64, tag = "2")] - pub tick_index_taker_to_maker: i64, - #[prost(string, tag = "3")] - pub tranche_key: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LimitOrderTranche { - #[prost(message, optional, tag = "1")] - pub key: ::core::option::Option, - #[prost(string, tag = "2")] - pub reserves_maker_denom: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub reserves_taker_denom: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub total_maker_denom: ::prost::alloc::string::String, - /// GoodTilDate is represented as seconds since January 1, year 1, 00:00:00.00 UTC - /// LimitOrders with goodTilDate set are valid as long as blockTime <= goodTilDate - #[prost(string, tag = "5")] - pub total_taker_denom: ::prost::alloc::string::String, - /// JIT orders also use goodTilDate to handle deletion but represent a special case - /// All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live - /// Order deletion still functions the same and the orders will be deleted at the end of the block - #[prost(message, optional, tag = "6")] - pub expiration_time: ::core::option::Option<::prost_types::Timestamp>, - #[prost(string, tag = "7")] - pub price_taker_to_maker: ::prost::alloc::string::String, + pub tick: i64, + #[prost(uint64, tag = "3")] + pub fee: u64, + #[prost(message, optional, tag = "4")] + pub pair_id: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct PoolReservesKey { @@ -292,17 +305,6 @@ pub mod tick_liquidity { LimitOrderTranche(super::LimitOrderTranche), } } -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PoolMetadata { - #[prost(uint64, tag = "1")] - pub id: u64, - #[prost(int64, tag = "2")] - pub tick: i64, - #[prost(uint64, tag = "3")] - pub fee: u64, - #[prost(message, optional, tag = "4")] - pub pair_id: ::core::option::Option, -} /// GenesisState defines the dex module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -328,7 +330,8 @@ pub struct LimitOrderExpiration { #[prost(bytes = "vec", tag = "2")] pub tranche_ref: ::prost::alloc::vec::Vec, } -// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool. +// NOTE: This struct is never actually stored in the KV store. It is merely a +// convenience wrapper for holding both sides of a pool. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pool { @@ -535,8 +538,8 @@ pub struct QueryEstimateMultiHopSwapRequest { pub amount_in: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub exit_limit_price: ::prost::alloc::string::String, - /// If pickBestRoute == true then all routes are run and the route with the best price is chosen - /// otherwise, the first succesful route is used. + /// If pickBestRoute == true then all routes are run and the route with the + /// best price is chosen otherwise, the first succesful route is used. #[prost(bool, tag = "6")] pub pick_best_route: bool, } @@ -570,15 +573,17 @@ pub struct QueryEstimatePlaceLimitOrderRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimatePlaceLimitOrderResponse { /// Total amount of coin used for the limit order - /// You can derive makerLimitInCoin using the equation: totalInCoin = swapInCoin + makerLimitInCoin + /// You can derive makerLimitInCoin using the equation: totalInCoin = + /// swapInCoin + makerLimitInCoin #[prost(message, optional, tag = "1")] pub total_in_coin: ::core::option::Option, /// Total amount of the token in that was immediately swapped for swapOutCoin #[prost(message, optional, tag = "2")] pub swap_in_coin: ::core::option::Option, /// Total amount of coin received from the taker portion of the limit order - /// This is the amount of coin immediately available in the users account after executing the - /// limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + /// This is the amount of coin immediately available in the users account after + /// executing the limit order. It does not include any future proceeds from the + /// maker portion which will have withdrawn in the future #[prost(message, optional, tag = "3")] pub swap_out_coin: ::core::option::Option, } diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs deleted file mode 100644 index be2f234d..00000000 --- a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.rs +++ /dev/null @@ -1,50 +0,0 @@ -// @generated -/// Params defines the parameters for the module. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// Defines maximum amount of messages to be passed in MsgSubmitTx - #[prost(uint64, tag = "1")] - pub msg_submit_tx_max_messages: u64, - /// Defines a minimum fee required to register interchain account - #[prost(message, repeated, tag = "2")] - pub register_fee: ::prost::alloc::vec::Vec, -} -/// GenesisState defines the interchaintxs module's genesis state. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// QueryParamsRequest is request type for the Query/Params RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is response type for the Query/Params RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params holds all the parameters of this module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryInterchainAccountAddressRequest { - /// owner_address is the owner of the interchain account on the controller - /// chain - #[prost(string, tag = "1")] - pub owner_address: ::prost::alloc::string::String, - /// interchain_account_id is an identifier of your interchain account from - /// which you want to execute msgs - #[prost(string, tag = "2")] - pub interchain_account_id: ::prost::alloc::string::String, - /// connection_id is an IBC connection identifier between Neutron and remote - /// chain - #[prost(string, tag = "3")] - pub connection_id: ::prost::alloc::string::String, -} -/// Query response for an interchain account address -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryInterchainAccountAddressResponse { - /// The corresponding interchain account address on the host chain - #[prost(string, tag = "1")] - pub interchain_account_address: ::prost::alloc::string::String, -} -// @@protoc_insertion_point(module) diff --git a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs index 45b47bd7..8bfefc25 100644 --- a/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs +++ b/packages/neutron-sdk/src/proto_types/neutron.interchaintxs.v1.rs @@ -1,4 +1,52 @@ // @generated +/// Params defines the parameters for the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Defines maximum amount of messages to be passed in MsgSubmitTx + #[prost(uint64, tag = "1")] + pub msg_submit_tx_max_messages: u64, + /// Defines a minimum fee required to register interchain account + #[prost(message, repeated, tag = "2")] + pub register_fee: ::prost::alloc::vec::Vec, +} +/// GenesisState defines the interchaintxs module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInterchainAccountAddressRequest { + /// owner_address is the owner of the interchain account on the controller + /// chain + #[prost(string, tag = "1")] + pub owner_address: ::prost::alloc::string::String, + /// interchain_account_id is an identifier of your interchain account from + /// which you want to execute msgs + #[prost(string, tag = "2")] + pub interchain_account_id: ::prost::alloc::string::String, + /// connection_id is an IBC connection identifier between Neutron and remote + /// chain + #[prost(string, tag = "3")] + pub connection_id: ::prost::alloc::string::String, +} +/// Query response for an interchain account address +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInterchainAccountAddressResponse { + /// The corresponding interchain account address on the host chain + #[prost(string, tag = "1")] + pub interchain_account_address: ::prost::alloc::string::String, +} /// MsgRegisterInterchainAccount is used to register an account on a remote zone. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccount { @@ -60,7 +108,7 @@ pub struct MsgUpdateParams { /// /// NOTE: All parameters must be supplied. #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub params: ::core::option::Option, } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. diff --git a/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs b/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs index e14b7d35..a56fbd9b 100644 --- a/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs +++ b/packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.v1beta1.rs @@ -22,7 +22,8 @@ pub struct Params { /// See: #[prost(uint64, tag = "2")] pub denom_creation_gas_consume: u64, - /// FeeCollectorAddress is the address where fees collected from denom creation are sent to + /// FeeCollectorAddress is the address where fees collected from denom creation + /// are sent to #[prost(string, tag = "3")] pub fee_collector_address: ::prost::alloc::string::String, }