From de6d10658d07802acf681a24d13e74b43e3d84fa Mon Sep 17 00:00:00 2001 From: v0-e <134806759+v0-e@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:16:54 +0000 Subject: [PATCH] Update Rust protos, dependencies enhancements (#2538) --- v4-proto-rs/Cargo.toml | 21 +- v4-proto-rs/README.md | 2 +- v4-proto-rs/build.rs | 75 +- v4-proto-rs/src/_includes.rs | 12 + v4-proto-rs/src/cosmos.base.query.v1beta1.rs | 2 - v4-proto-rs/src/cosmos.base.v1beta1.rs | 4 - v4-proto-rs/src/cosmos_proto.rs | 8 +- v4-proto-rs/src/dydxprotocol.accountplus.rs | 713 +++++++ v4-proto-rs/src/dydxprotocol.affiliates.rs | 734 ++++++++ v4-proto-rs/src/dydxprotocol.assets.rs | 44 +- v4-proto-rs/src/dydxprotocol.blocktime.rs | 69 +- v4-proto-rs/src/dydxprotocol.bridge.rs | 126 +- v4-proto-rs/src/dydxprotocol.clob.rs | 502 ++--- .../src/dydxprotocol.daemons.bridge.rs | 22 +- .../src/dydxprotocol.daemons.liquidation.rs | 22 +- .../src/dydxprotocol.daemons.pricefeed.rs | 24 +- v4-proto-rs/src/dydxprotocol.delaymsg.rs | 63 +- v4-proto-rs/src/dydxprotocol.epochs.rs | 27 +- v4-proto-rs/src/dydxprotocol.feetiers.rs | 52 +- v4-proto-rs/src/dydxprotocol.govplus.rs | 40 +- .../src/dydxprotocol.indexer.events.rs | 106 +- .../dydxprotocol.indexer.indexer_manager.rs | 13 +- .../dydxprotocol.indexer.off_chain_updates.rs | 33 +- .../src/dydxprotocol.indexer.protocol.v1.rs | 89 +- v4-proto-rs/src/dydxprotocol.indexer.redis.rs | 7 +- .../src/dydxprotocol.indexer.shared.rs | 38 +- v4-proto-rs/src/dydxprotocol.indexer.socks.rs | 42 +- v4-proto-rs/src/dydxprotocol.listing.rs | 538 ++++++ v4-proto-rs/src/dydxprotocol.perpetuals.rs | 123 +- v4-proto-rs/src/dydxprotocol.prices.rs | 95 +- v4-proto-rs/src/dydxprotocol.ratelimit.rs | 62 +- v4-proto-rs/src/dydxprotocol.revshare.rs | 671 +++++++ v4-proto-rs/src/dydxprotocol.rewards.rs | 47 +- v4-proto-rs/src/dydxprotocol.sending.rs | 62 +- v4-proto-rs/src/dydxprotocol.stats.rs | 111 +- v4-proto-rs/src/dydxprotocol.subaccounts.rs | 125 +- v4-proto-rs/src/dydxprotocol.vault.rs | 1643 +++++++++++++---- v4-proto-rs/src/dydxprotocol.vest.rs | 51 +- v4-proto-rs/src/google.api.rs | 4 - v4-proto-rs/src/lib.rs | 9 +- 40 files changed, 5137 insertions(+), 1294 deletions(-) create mode 100644 v4-proto-rs/src/dydxprotocol.accountplus.rs create mode 100644 v4-proto-rs/src/dydxprotocol.affiliates.rs create mode 100644 v4-proto-rs/src/dydxprotocol.listing.rs create mode 100644 v4-proto-rs/src/dydxprotocol.revshare.rs diff --git a/v4-proto-rs/Cargo.toml b/v4-proto-rs/Cargo.toml index 8c2e82dd60..3c91472dd4 100644 --- a/v4-proto-rs/Cargo.toml +++ b/v4-proto-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dydx-proto" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "Compiled dYdX protobuf files" repository = "https://github.com/dydxprotocol/v4-chain/tree/main/v4-proto-rs" @@ -9,13 +9,18 @@ license = "LicenseRef-dYdX-Custom" [lib] doctest = false +[features] +default = ["grpc-transport"] +grpc-transport = ["tonic/transport"] + [dependencies] -cosmos-sdk-proto = "0.21.1" -tonic = { version = "0.11", features = ["tls", "tls-roots", "transport", "channel"] } -prost = "0.12" -prost-types = "0.12" +cosmos-sdk-proto = { version = "0.26", default-features = false, features = ["grpc"] } +prost = { version = "0.13", default-features = false } +prost-types = "0.13" +tonic = { version = "0.12", default-features = false, features = ["codegen", "prost"] } [build-dependencies] -tonic-buf-build = "0.2.1" -prost-build = "0.12" # keep the version the same as in tonic-buf-build -tonic-build = "0.11" # keep the version the same as in tonic-buf-build +regex = "1.11.1" +tonic-buf-build = "0.3.0" +prost-build = "0.13" # keep the version the same as in tonic-buf-build +tonic-build = "0.12" # keep the version the same as in tonic-buf-build diff --git a/v4-proto-rs/README.md b/v4-proto-rs/README.md index 9f95646255..911a676723 100644 --- a/v4-proto-rs/README.md +++ b/v4-proto-rs/README.md @@ -6,7 +6,7 @@ Cargo.toml ```toml [dependencies] -dydx-proto = "0.1" +dydx-proto = "0.2" ``` *Note:* by default, rust stub files are not rebuilt (see Q&A below) diff --git a/v4-proto-rs/build.rs b/v4-proto-rs/build.rs index dfad90ed8c..01faebdb11 100644 --- a/v4-proto-rs/build.rs +++ b/v4-proto-rs/build.rs @@ -1,28 +1,59 @@ use prost_build::Config; +use regex::Regex; use std::env; -use std::path::PathBuf; - -fn main() -> Result<(), tonic_buf_build::error::TonicBufBuildError> { - if std::env::var("V4_PROTO_REBUILD").is_ok() { - let mut config = Config::new(); - config.out_dir("src"); - config.include_file("_includes.rs"); - config.enable_type_names(); - let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").map_err(|e| { - tonic_buf_build::error::TonicBufBuildError { - message: format!("Failed to get CARGO_MANIFEST_DIR: {}", e), - cause: None, - } - })?); - path.pop(); - tonic_buf_build::compile_from_buf_workspace_with_config( - tonic_build::configure().build_server(false), - Some(config), - tonic_buf_build::TonicBufConfig { - buf_dir: Some(path), - }, - )?; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; + +const OUT_DIR: &str = "src"; + +fn features_patch(dir: impl AsRef) -> io::Result<()> { + let regex = "impl(.+)tonic::transport(.+)"; + let replacement = "#[cfg(feature = \"grpc-transport\")]\n \ + impl${1}tonic::transport${2}"; + + let paths = fs::read_dir(dir)?; + + for entry in paths { + let path = entry?.path(); + let mut contents = fs::read_to_string(&path)?; + + contents = Regex::new(regex) + .map_err(|e| io::Error::new(io::ErrorKind::Other, e))? + .replace_all(&contents, replacement) + .to_string(); + + fs::write(&path, &contents)? } Ok(()) } + +fn main() -> Result<(), Box> { + if !std::env::var("V4_PROTO_REBUILD").is_ok() { + return Ok(()); + } + + let mut config = Config::new(); + config.out_dir(OUT_DIR); + config.include_file("_includes.rs"); + config.enable_type_names(); + let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").map_err(|e| { + tonic_buf_build::error::TonicBufBuildError { + message: format!("Failed to get CARGO_MANIFEST_DIR: {}", e), + cause: None, + } + })?); + path.pop(); + tonic_buf_build::compile_from_buf_workspace_with_config( + tonic_build::configure().build_server(false), + Some(config), + tonic_buf_build::TonicBufConfig { + buf_dir: Some(path), + }, + )?; + + features_patch(OUT_DIR)?; + + Ok(()) +} diff --git a/v4-proto-rs/src/_includes.rs b/v4-proto-rs/src/_includes.rs index edcb46e6a8..67c39ce08d 100644 --- a/v4-proto-rs/src/_includes.rs +++ b/v4-proto-rs/src/_includes.rs @@ -15,6 +15,12 @@ pub mod cosmos_proto { include!("cosmos_proto.rs"); } pub mod dydxprotocol { + pub mod accountplus { + include!("dydxprotocol.accountplus.rs"); + } + pub mod affiliates { + include!("dydxprotocol.affiliates.rs"); + } pub mod assets { include!("dydxprotocol.assets.rs"); } @@ -75,6 +81,9 @@ pub mod dydxprotocol { include!("dydxprotocol.indexer.socks.rs"); } } + pub mod listing { + include!("dydxprotocol.listing.rs"); + } pub mod perpetuals { include!("dydxprotocol.perpetuals.rs"); } @@ -84,6 +93,9 @@ pub mod dydxprotocol { pub mod ratelimit { include!("dydxprotocol.ratelimit.rs"); } + pub mod revshare { + include!("dydxprotocol.revshare.rs"); + } pub mod rewards { include!("dydxprotocol.rewards.rs"); } diff --git a/v4-proto-rs/src/cosmos.base.query.v1beta1.rs b/v4-proto-rs/src/cosmos.base.query.v1beta1.rs index dc11f529f4..8ff320df95 100644 --- a/v4-proto-rs/src/cosmos.base.query.v1beta1.rs +++ b/v4-proto-rs/src/cosmos.base.query.v1beta1.rs @@ -6,7 +6,6 @@ /// Foo some_parameter = 1; /// PageRequest pagination = 2; /// } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageRequest { /// key is a value returned in PageResponse.next_key to begin @@ -52,7 +51,6 @@ impl ::prost::Name for PageRequest { /// repeated Bar results = 1; /// PageResponse page = 2; /// } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageResponse { /// next_key is the key to be passed to PageRequest.key to diff --git a/v4-proto-rs/src/cosmos.base.v1beta1.rs b/v4-proto-rs/src/cosmos.base.v1beta1.rs index 8a61cfab7a..1c10d66da1 100644 --- a/v4-proto-rs/src/cosmos.base.v1beta1.rs +++ b/v4-proto-rs/src/cosmos.base.v1beta1.rs @@ -3,7 +3,6 @@ /// /// NOTE: The amount field is an Int which implements the custom method /// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Coin { #[prost(string, tag = "1")] @@ -25,7 +24,6 @@ impl ::prost::Name for Coin { /// /// NOTE: The amount field is an Dec which implements the custom method /// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecCoin { #[prost(string, tag = "1")] @@ -45,7 +43,6 @@ impl ::prost::Name for DecCoin { } /// IntProto defines a Protobuf wrapper around an Int object. /// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IntProto { #[prost(string, tag = "1")] @@ -63,7 +60,6 @@ impl ::prost::Name for IntProto { } /// DecProto defines a Protobuf wrapper around a Dec object. /// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecProto { #[prost(string, tag = "1")] diff --git a/v4-proto-rs/src/cosmos_proto.rs b/v4-proto-rs/src/cosmos_proto.rs index e45172e7ee..9057ec92dd 100644 --- a/v4-proto-rs/src/cosmos_proto.rs +++ b/v4-proto-rs/src/cosmos_proto.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// InterfaceDescriptor describes an interface type to be used with /// accepts_interface and implements_interface and declared by declare_interface. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { /// name is the name of the interface. It should be a short-name (without @@ -32,7 +31,6 @@ impl ::prost::Name for InterfaceDescriptor { /// 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. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScalarDescriptor { /// name is the name of the scalar. It should be a short-name (without @@ -77,9 +75,9 @@ impl ScalarType { /// (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", + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/v4-proto-rs/src/dydxprotocol.accountplus.rs b/v4-proto-rs/src/dydxprotocol.accountplus.rs new file mode 100644 index 0000000000..66c3177c2e --- /dev/null +++ b/v4-proto-rs/src/dydxprotocol.accountplus.rs @@ -0,0 +1,713 @@ +// This file is @generated by prost-build. +/// Account State +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountState { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub timestamp_nonce_details: ::core::option::Option, +} +impl ::prost::Name for AccountState { + const NAME: &'static str = "AccountState"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.AccountState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.AccountState".into() + } +} +/// Timestamp nonce details +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TimestampNonceDetails { + /// unsorted list of n most recent timestamp nonces + #[prost(uint64, repeated, tag = "1")] + pub timestamp_nonces: ::prost::alloc::vec::Vec, + /// max timestamp nonce that was ejected from list above + #[prost(uint64, tag = "2")] + pub max_ejected_nonce: u64, +} +impl ::prost::Name for TimestampNonceDetails { + const NAME: &'static str = "TimestampNonceDetails"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.TimestampNonceDetails".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.TimestampNonceDetails".into() + } +} +/// AccountAuthenticator represents a foundational model for all authenticators. +/// It provides extensibility by allowing concrete types to interpret and +/// validate transactions based on the encapsulated data. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountAuthenticator { + /// ID uniquely identifies the authenticator instance. + #[prost(uint64, tag = "1")] + pub id: u64, + /// Type specifies the category of the AccountAuthenticator. + /// This type information is essential for differentiating authenticators + /// and ensuring precise data retrieval from the storage layer. + #[prost(string, tag = "2")] + pub r#type: ::prost::alloc::string::String, + /// Config is a versatile field used in conjunction with the specific type of + /// account authenticator to facilitate complex authentication processes. + /// The interpretation of this field is overloaded, enabling multiple + /// authenticators to utilize it for their respective purposes. + #[prost(bytes = "vec", tag = "3")] + pub config: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for AccountAuthenticator { + const NAME: &'static str = "AccountAuthenticator"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.AccountAuthenticator".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.AccountAuthenticator".into() + } +} +/// Params defines the parameters for the module. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Params { + /// IsSmartAccountActive defines the state of the authenticator. + /// If set to false, the authenticator module will not be used + /// and the classic cosmos sdk authentication will be used instead. + #[prost(bool, tag = "1")] + pub is_smart_account_active: bool, +} +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.Params".into() + } +} +/// AuthenticatorData represents a genesis exported account with Authenticators. +/// The address is used as the key, and the account authenticators are stored in +/// the authenticators field. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthenticatorData { + /// address is an account address, one address can have many authenticators + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// authenticators are the account's authenticators, these can be multiple + /// types including SignatureVerification, AllOfs, CosmWasmAuthenticators, etc + #[prost(message, repeated, tag = "2")] + pub authenticators: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for AuthenticatorData { + const NAME: &'static str = "AuthenticatorData"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.AuthenticatorData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.AuthenticatorData".into() + } +} +/// Module genesis state +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec, + /// params define the parameters for the authenticator module. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, + /// next_authenticator_id is the next available authenticator ID. + #[prost(uint64, tag = "3")] + pub next_authenticator_id: u64, + /// authenticator_data contains the data for multiple accounts, each with their + /// authenticators. + #[prost(message, repeated, tag = "4")] + pub authenticator_data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.GenesisState".into() + } +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.QueryParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.QueryParamsRequest".into() + } +} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.QueryParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.QueryParamsResponse".into() + } +} +/// MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAuthenticatorsRequest { + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +impl ::prost::Name for GetAuthenticatorsRequest { + const NAME: &'static str = "GetAuthenticatorsRequest"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.GetAuthenticatorsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.GetAuthenticatorsRequest".into() + } +} +/// MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAuthenticatorsResponse { + #[prost(message, repeated, tag = "1")] + pub account_authenticators: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GetAuthenticatorsResponse { + const NAME: &'static str = "GetAuthenticatorsResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.GetAuthenticatorsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.GetAuthenticatorsResponse".into() + } +} +/// MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAuthenticatorRequest { + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub authenticator_id: u64, +} +impl ::prost::Name for GetAuthenticatorRequest { + const NAME: &'static str = "GetAuthenticatorRequest"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.GetAuthenticatorRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.GetAuthenticatorRequest".into() + } +} +/// MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAuthenticatorResponse { + #[prost(message, optional, tag = "1")] + pub account_authenticator: ::core::option::Option, +} +impl ::prost::Name for GetAuthenticatorResponse { + const NAME: &'static str = "GetAuthenticatorResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.GetAuthenticatorResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.GetAuthenticatorResponse".into() + } +} +/// Generated client implementations. +pub mod query_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query defines the gRPC querier service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.accountplus.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /// Queries a single authenticator by account and authenticator ID. + pub async fn get_authenticator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Query/GetAuthenticator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.accountplus.Query", "GetAuthenticator"), + ); + self.inner.unary(req, path, codec).await + } + /// Queries all authenticators for a given account. + pub async fn get_authenticators( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Query/GetAuthenticators", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.accountplus.Query", + "GetAuthenticators", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAddAuthenticator { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub authenticator_type: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgAddAuthenticator { + const NAME: &'static str = "MsgAddAuthenticator"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgAddAuthenticator".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgAddAuthenticator".into() + } +} +/// MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAddAuthenticatorResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +impl ::prost::Name for MsgAddAuthenticatorResponse { + const NAME: &'static str = "MsgAddAuthenticatorResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgAddAuthenticatorResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgAddAuthenticatorResponse".into() + } +} +/// MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request +/// type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveAuthenticator { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub id: u64, +} +impl ::prost::Name for MsgRemoveAuthenticator { + const NAME: &'static str = "MsgRemoveAuthenticator"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgRemoveAuthenticator".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgRemoveAuthenticator".into() + } +} +/// MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response +/// type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgRemoveAuthenticatorResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +impl ::prost::Name for MsgRemoveAuthenticatorResponse { + const NAME: &'static str = "MsgRemoveAuthenticatorResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgRemoveAuthenticatorResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgRemoveAuthenticatorResponse".into() + } +} +/// MsgSetActiveState sets the active state of the module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetActiveState { + /// Authority is the address that may send this message. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub active: bool, +} +impl ::prost::Name for MsgSetActiveState { + const NAME: &'static str = "MsgSetActiveState"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgSetActiveState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgSetActiveState".into() + } +} +/// MsgSetActiveStateResponse defines the Msg/SetActiveState response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetActiveStateResponse {} +impl ::prost::Name for MsgSetActiveStateResponse { + const NAME: &'static str = "MsgSetActiveStateResponse"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.MsgSetActiveStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.MsgSetActiveStateResponse".into() + } +} +/// TxExtension allows for additional authenticator-specific data in +/// transactions. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxExtension { + /// selected_authenticators holds the authenticator_id for the chosen + /// authenticator per message. + #[prost(uint64, repeated, tag = "1")] + pub selected_authenticators: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for TxExtension { + const NAME: &'static str = "TxExtension"; + const PACKAGE: &'static str = "dydxprotocol.accountplus"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.accountplus.TxExtension".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.accountplus.TxExtension".into() + } +} +/// Generated client implementations. +pub mod msg_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Msg defines the Msg service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// AddAuthenticator adds an authenticator to an account. + pub async fn add_authenticator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Msg/AddAuthenticator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.accountplus.Msg", "AddAuthenticator"), + ); + self.inner.unary(req, path, codec).await + } + /// RemoveAuthenticator removes an authenticator from an account. + pub async fn remove_authenticator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Msg/RemoveAuthenticator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.accountplus.Msg", + "RemoveAuthenticator", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SetActiveState sets the active state of the authenticator. + /// Primarily used for circuit breaking. + pub async fn set_active_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.accountplus.Msg/SetActiveState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.accountplus.Msg", "SetActiveState"), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/v4-proto-rs/src/dydxprotocol.affiliates.rs b/v4-proto-rs/src/dydxprotocol.affiliates.rs new file mode 100644 index 0000000000..48e1db0064 --- /dev/null +++ b/v4-proto-rs/src/dydxprotocol.affiliates.rs @@ -0,0 +1,734 @@ +// This file is @generated by prost-build. +/// AffiliateTiers defines the affiliate tiers. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AffiliateTiers { + /// All affiliate tiers + #[prost(message, repeated, tag = "1")] + pub tiers: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `AffiliateTiers`. +pub mod affiliate_tiers { + /// Tier defines an affiliate tier. + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct Tier { + /// Required all-time referred volume in quote quantums. + #[prost(uint64, tag = "1")] + pub req_referred_volume_quote_quantums: u64, + /// Required currently staked native tokens (in whole coins). + #[prost(uint32, tag = "2")] + pub req_staked_whole_coins: u32, + /// Taker fee share in parts-per-million. + #[prost(uint32, tag = "3")] + pub taker_fee_share_ppm: u32, + } + impl ::prost::Name for Tier { + const NAME: &'static str = "Tier"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateTiers.Tier".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateTiers.Tier".into() + } + } +} +impl ::prost::Name for AffiliateTiers { + const NAME: &'static str = "AffiliateTiers"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateTiers".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateTiers".into() + } +} +/// AffiliateWhitelist specifies the whitelisted affiliates. +/// If an address is in the whitelist, then the affiliate fee share in +/// this object will override fee share from the regular affiliate tiers above. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AffiliateWhitelist { + /// All affiliate whitelist tiers. + #[prost(message, repeated, tag = "1")] + pub tiers: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `AffiliateWhitelist`. +pub mod affiliate_whitelist { + /// Tier defines an affiliate whitelist tier. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Tier { + /// List of unique whitelisted addresses. + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Taker fee share in parts-per-million. + #[prost(uint32, tag = "2")] + pub taker_fee_share_ppm: u32, + } + impl ::prost::Name for Tier { + const NAME: &'static str = "Tier"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateWhitelist.Tier".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateWhitelist.Tier".into() + } + } +} +impl ::prost::Name for AffiliateWhitelist { + const NAME: &'static str = "AffiliateWhitelist"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateWhitelist".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateWhitelist".into() + } +} +/// GenesisState defines generis state of `x/affiliates` +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// The list of affiliate tiers + #[prost(message, optional, tag = "1")] + pub affiliate_tiers: ::core::option::Option, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.GenesisState".into() + } +} +/// AffiliateInfoRequest is the request type for the Query/AffiliateInfo RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AffiliateInfoRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +impl ::prost::Name for AffiliateInfoRequest { + const NAME: &'static str = "AffiliateInfoRequest"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateInfoRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateInfoRequest".into() + } +} +/// AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AffiliateInfoResponse { + /// Whether the address is a whitelisted affiliate (VIP). + #[prost(bool, tag = "1")] + pub is_whitelisted: bool, + /// If `is_whiteslisted == false`, the affiliate's tier qualified through + /// regular affiliate program. + #[prost(uint32, tag = "2")] + pub tier: u32, + /// The affiliate's taker fee share in parts-per-million (for both VIP and + /// regular affiliate). + #[prost(uint32, tag = "3")] + pub fee_share_ppm: u32, + /// The affiliate's all-time referred volume in quote quantums. + #[prost(bytes = "vec", tag = "4")] + pub referred_volume: ::prost::alloc::vec::Vec, + /// The affiliate's currently staked native tokens (in whole coins). + #[prost(bytes = "vec", tag = "5")] + pub staked_amount: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for AffiliateInfoResponse { + const NAME: &'static str = "AffiliateInfoResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateInfoResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateInfoResponse".into() + } +} +/// ReferredByRequest is the request type for the Query/ReferredBy RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ReferredByRequest { + /// The address to query. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +impl ::prost::Name for ReferredByRequest { + const NAME: &'static str = "ReferredByRequest"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.ReferredByRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.ReferredByRequest".into() + } +} +/// ReferredByResponse is the response type for the Query/ReferredBy RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ReferredByResponse { + /// The affiliate's address that referred the queried address. + #[prost(string, tag = "1")] + pub affiliate_address: ::prost::alloc::string::String, +} +impl ::prost::Name for ReferredByResponse { + const NAME: &'static str = "ReferredByResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.ReferredByResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.ReferredByResponse".into() + } +} +/// AllAffiliateTiersRequest is the request type for the Query/AllAffiliateTiers +/// RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AllAffiliateTiersRequest {} +impl ::prost::Name for AllAffiliateTiersRequest { + const NAME: &'static str = "AllAffiliateTiersRequest"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AllAffiliateTiersRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AllAffiliateTiersRequest".into() + } +} +/// AllAffiliateTiersResponse is the response type for the +/// Query/AllAffiliateTiers RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AllAffiliateTiersResponse { + /// All affiliate tiers information. + #[prost(message, optional, tag = "1")] + pub tiers: ::core::option::Option, +} +impl ::prost::Name for AllAffiliateTiersResponse { + const NAME: &'static str = "AllAffiliateTiersResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AllAffiliateTiersResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AllAffiliateTiersResponse".into() + } +} +/// AffiliateWhitelistRequest is the request type for the +/// Query/AffiliateWhitelist RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AffiliateWhitelistRequest {} +impl ::prost::Name for AffiliateWhitelistRequest { + const NAME: &'static str = "AffiliateWhitelistRequest"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateWhitelistRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateWhitelistRequest".into() + } +} +/// AffiliateWhitelistResponse is the response type for the +/// Query/AffiliateWhitelist RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AffiliateWhitelistResponse { + #[prost(message, optional, tag = "1")] + pub whitelist: ::core::option::Option, +} +impl ::prost::Name for AffiliateWhitelistResponse { + const NAME: &'static str = "AffiliateWhitelistResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.AffiliateWhitelistResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.AffiliateWhitelistResponse".into() + } +} +/// Generated client implementations. +pub mod query_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query defines the gRPC querier service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// Query AffiliateInfo returns the affiliate info for a given address. + pub async fn affiliate_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Query/AffiliateInfo", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.affiliates.Query", "AffiliateInfo"), + ); + self.inner.unary(req, path, codec).await + } + /// Query ReferredBy returns the affiliate that referred a given address. + pub async fn referred_by( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Query/ReferredBy", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.affiliates.Query", "ReferredBy")); + self.inner.unary(req, path, codec).await + } + /// Query AllAffiliateTiers returns all affiliate tiers. + pub async fn all_affiliate_tiers( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Query/AllAffiliateTiers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.affiliates.Query", "AllAffiliateTiers"), + ); + self.inner.unary(req, path, codec).await + } + /// Query AffiliateWhitelist returns the affiliate whitelist. + pub async fn affiliate_whitelist( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Query/AffiliateWhitelist", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.affiliates.Query", + "AffiliateWhitelist", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Message to register a referee-affiliate relationship +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterAffiliate { + /// Address of the referee + #[prost(string, tag = "1")] + pub referee: ::prost::alloc::string::String, + /// Address of the affiliate + #[prost(string, tag = "2")] + pub affiliate: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgRegisterAffiliate { + const NAME: &'static str = "MsgRegisterAffiliate"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgRegisterAffiliate".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgRegisterAffiliate".into() + } +} +/// Response to MsgRegisterAffiliate +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgRegisterAffiliateResponse {} +impl ::prost::Name for MsgRegisterAffiliateResponse { + const NAME: &'static str = "MsgRegisterAffiliateResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgRegisterAffiliateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgRegisterAffiliateResponse".into() + } +} +/// Message to update affiliate tiers +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateAffiliateTiers { + /// Authority sending this message. Will be sent by gov + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Updated affiliate tiers information + #[prost(message, optional, tag = "2")] + pub tiers: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateAffiliateTiers { + const NAME: &'static str = "MsgUpdateAffiliateTiers"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgUpdateAffiliateTiers".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiers".into() + } +} +/// Response to MsgUpdateAffiliateTiers +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateAffiliateTiersResponse {} +impl ::prost::Name for MsgUpdateAffiliateTiersResponse { + const NAME: &'static str = "MsgUpdateAffiliateTiersResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgUpdateAffiliateTiersResponse".into() + } +} +/// Message to update affiliate whitelist +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateAffiliateWhitelist { + /// Authority sending this message. Will be sent by gov + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Updated affiliate whitelist information + #[prost(message, optional, tag = "2")] + pub whitelist: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateAffiliateWhitelist { + const NAME: &'static str = "MsgUpdateAffiliateWhitelist"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelist".into() + } +} +/// Response to MsgUpdateAffiliateWhitelist +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateAffiliateWhitelistResponse {} +impl ::prost::Name for MsgUpdateAffiliateWhitelistResponse { + const NAME: &'static str = "MsgUpdateAffiliateWhitelistResponse"; + const PACKAGE: &'static str = "dydxprotocol.affiliates"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.affiliates.MsgUpdateAffiliateWhitelistResponse".into() + } +} +/// Generated client implementations. +pub mod msg_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Msg defines the Msg service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// RegisterAffiliate registers a referee-affiliate relationship + pub async fn register_affiliate( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Msg/RegisterAffiliate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.affiliates.Msg", "RegisterAffiliate"), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAffiliateTiers updates affiliate tiers + pub async fn update_affiliate_tiers( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Msg/UpdateAffiliateTiers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.affiliates.Msg", + "UpdateAffiliateTiers", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAffiliateWhitelist updates affiliate whitelist + pub async fn update_affiliate_whitelist( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.affiliates.Msg/UpdateAffiliateWhitelist", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.affiliates.Msg", + "UpdateAffiliateWhitelist", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/v4-proto-rs/src/dydxprotocol.assets.rs b/v4-proto-rs/src/dydxprotocol.assets.rs index 04c175b7d0..b79ee590fd 100644 --- a/v4-proto-rs/src/dydxprotocol.assets.rs +++ b/v4-proto-rs/src/dydxprotocol.assets.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Asset defines a single exchangable asset. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Asset { /// Unique, sequentially-generated. @@ -51,7 +50,6 @@ impl ::prost::Name for Asset { } } /// GenesisState defines the assets module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] @@ -68,8 +66,7 @@ impl ::prost::Name for GenesisState { } } /// Queries an Asset by id. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryAssetRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -85,7 +82,6 @@ impl ::prost::Name for QueryAssetRequest { } } /// QueryAssetResponse is response type for the Asset RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAssetResponse { #[prost(message, optional, tag = "1")] @@ -102,7 +98,6 @@ impl ::prost::Name for QueryAssetResponse { } } /// Queries a list of Asset items. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllAssetsRequest { #[prost(message, optional, tag = "1")] @@ -121,7 +116,6 @@ impl ::prost::Name for QueryAllAssetsRequest { } } /// QueryAllAssetsResponse is response type for the AllAssets RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllAssetsResponse { #[prost(message, repeated, tag = "1")] @@ -143,7 +137,13 @@ impl ::prost::Name for QueryAllAssetsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -151,6 +151,7 @@ pub mod query_client { 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 @@ -166,8 +167,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -192,7 +193,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -239,8 +240,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -265,8 +265,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -283,7 +282,13 @@ pub mod query_client { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -291,6 +296,7 @@ pub mod msg_client { 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 @@ -306,8 +312,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -332,7 +338,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } diff --git a/v4-proto-rs/src/dydxprotocol.blocktime.rs b/v4-proto-rs/src/dydxprotocol.blocktime.rs index c92356fc7b..fa804567ec 100644 --- a/v4-proto-rs/src/dydxprotocol.blocktime.rs +++ b/v4-proto-rs/src/dydxprotocol.blocktime.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// BlockInfo stores information about a block -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BlockInfo { #[prost(uint32, tag = "1")] pub height: u32, @@ -19,7 +18,6 @@ impl ::prost::Name for BlockInfo { } } /// AllDowntimeInfo stores information for all downtime durations. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllDowntimeInfo { /// The downtime information for each tracked duration. Sorted by duration, @@ -31,8 +29,7 @@ pub struct AllDowntimeInfo { pub mod all_downtime_info { /// Stores information about downtime. block_info corresponds to the most /// recent block at which a downtime occurred. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DowntimeInfo { #[prost(message, optional, tag = "1")] pub duration: ::core::option::Option<::prost_types::Duration>, @@ -61,7 +58,6 @@ impl ::prost::Name for AllDowntimeInfo { } } /// DowntimeParams defines the parameters for downtime. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DowntimeParams { /// Durations tracked for downtime. The durations must be sorted from @@ -80,7 +76,6 @@ impl ::prost::Name for DowntimeParams { } } /// GenesisState defines the blocktime module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, optional, tag = "1")] @@ -98,8 +93,7 @@ impl ::prost::Name for GenesisState { } /// QueryDowntimeParamsRequest is a request type for the DowntimeParams /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryDowntimeParamsRequest {} impl ::prost::Name for QueryDowntimeParamsRequest { const NAME: &'static str = "QueryDowntimeParamsRequest"; @@ -113,7 +107,6 @@ impl ::prost::Name for QueryDowntimeParamsRequest { } /// QueryDowntimeParamsResponse is a response type for the DowntimeParams /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDowntimeParamsResponse { #[prost(message, optional, tag = "1")] @@ -131,8 +124,7 @@ impl ::prost::Name for QueryDowntimeParamsResponse { } /// QueryPreviousBlockInfoRequest is a request type for the PreviousBlockInfo /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPreviousBlockInfoRequest {} impl ::prost::Name for QueryPreviousBlockInfoRequest { const NAME: &'static str = "QueryPreviousBlockInfoRequest"; @@ -146,8 +138,7 @@ impl ::prost::Name for QueryPreviousBlockInfoRequest { } /// QueryPreviousBlockInfoResponse is a request type for the PreviousBlockInfo /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPreviousBlockInfoResponse { #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, @@ -164,8 +155,7 @@ impl ::prost::Name for QueryPreviousBlockInfoResponse { } /// QueryAllDowntimeInfoRequest is a request type for the AllDowntimeInfo /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryAllDowntimeInfoRequest {} impl ::prost::Name for QueryAllDowntimeInfoRequest { const NAME: &'static str = "QueryAllDowntimeInfoRequest"; @@ -179,7 +169,6 @@ impl ::prost::Name for QueryAllDowntimeInfoRequest { } /// QueryAllDowntimeInfoResponse is a request type for the AllDowntimeInfo /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllDowntimeInfoResponse { #[prost(message, optional, tag = "1")] @@ -197,7 +186,13 @@ impl ::prost::Name for QueryAllDowntimeInfoResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -205,6 +200,7 @@ pub mod query_client { 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 @@ -220,8 +216,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -246,7 +242,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -293,8 +289,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -321,8 +316,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -349,8 +343,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -368,7 +361,6 @@ pub mod query_client { } } /// MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateDowntimeParams { #[prost(string, tag = "1")] @@ -389,8 +381,7 @@ impl ::prost::Name for MsgUpdateDowntimeParams { } /// MsgUpdateDowntimeParamsResponse is the Msg/UpdateDowntimeParams response /// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateDowntimeParamsResponse {} impl ::prost::Name for MsgUpdateDowntimeParamsResponse { const NAME: &'static str = "MsgUpdateDowntimeParamsResponse"; @@ -404,7 +395,13 @@ impl ::prost::Name for MsgUpdateDowntimeParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -412,6 +409,7 @@ pub mod msg_client { 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 @@ -427,8 +425,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -453,7 +451,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -500,8 +498,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.bridge.rs b/v4-proto-rs/src/dydxprotocol.bridge.rs index 43d0e28ca0..abea313aca 100644 --- a/v4-proto-rs/src/dydxprotocol.bridge.rs +++ b/v4-proto-rs/src/dydxprotocol.bridge.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// BridgeEvent is a recognized event from the Ethereum blockchain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BridgeEvent { /// The unique id of the Ethereum event log. @@ -28,8 +27,7 @@ impl ::prost::Name for BridgeEvent { } /// BridgeEventInfo stores information about the most recently processed bridge /// event. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BridgeEventInfo { /// The next event id (the last processed id plus one) of the logs from the /// Ethereum contract. @@ -51,7 +49,6 @@ impl ::prost::Name for BridgeEventInfo { } /// EventParams stores parameters about which events to recognize and which /// tokens to mint. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventParams { /// The denom of the token to mint. @@ -75,8 +72,7 @@ impl ::prost::Name for EventParams { } } /// ProposeParams stores parameters for proposing to the module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ProposeParams { /// The maximum number of bridge events to propose per block. /// Limits the number of events to propose in a single block @@ -112,8 +108,7 @@ impl ::prost::Name for ProposeParams { } } /// SafetyParams stores safety parameters for the module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SafetyParams { /// True if bridging is disabled. #[prost(bool, tag = "1")] @@ -134,7 +129,6 @@ impl ::prost::Name for SafetyParams { } } /// GenesisState defines the bridge module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// The parameters of the module. @@ -161,7 +155,6 @@ impl ::prost::Name for GenesisState { } } /// MsgAcknowledgeBridges is the Msg/AcknowledgeBridges request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgeBridges { /// The events to acknowledge. @@ -180,8 +173,7 @@ impl ::prost::Name for MsgAcknowledgeBridges { } /// MsgAcknowledgeBridgesResponse is the Msg/AcknowledgeBridgesResponse response /// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAcknowledgeBridgesResponse {} impl ::prost::Name for MsgAcknowledgeBridgesResponse { const NAME: &'static str = "MsgAcknowledgeBridgesResponse"; @@ -194,7 +186,6 @@ impl ::prost::Name for MsgAcknowledgeBridgesResponse { } } /// MsgCompleteBridge is the Msg/CompleteBridgeResponse request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCompleteBridge { #[prost(string, tag = "1")] @@ -214,8 +205,7 @@ impl ::prost::Name for MsgCompleteBridge { } } /// MsgCompleteBridgeResponse is the Msg/CompleteBridgeResponse response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCompleteBridgeResponse {} impl ::prost::Name for MsgCompleteBridgeResponse { const NAME: &'static str = "MsgCompleteBridgeResponse"; @@ -228,7 +218,6 @@ impl ::prost::Name for MsgCompleteBridgeResponse { } } /// MsgUpdateEventParams is the Msg/UpdateEventParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateEventParams { #[prost(string, tag = "1")] @@ -248,8 +237,7 @@ impl ::prost::Name for MsgUpdateEventParams { } } /// MsgUpdateEventParamsResponse is the Msg/UpdateEventParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateEventParamsResponse {} impl ::prost::Name for MsgUpdateEventParamsResponse { const NAME: &'static str = "MsgUpdateEventParamsResponse"; @@ -262,7 +250,6 @@ impl ::prost::Name for MsgUpdateEventParamsResponse { } } /// MsgUpdateProposeParams is the Msg/UpdateProposeParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateProposeParams { #[prost(string, tag = "1")] @@ -282,8 +269,7 @@ impl ::prost::Name for MsgUpdateProposeParams { } } /// MsgUpdateProposeParamsResponse is the Msg/UpdateProposeParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateProposeParamsResponse {} impl ::prost::Name for MsgUpdateProposeParamsResponse { const NAME: &'static str = "MsgUpdateProposeParamsResponse"; @@ -296,7 +282,6 @@ impl ::prost::Name for MsgUpdateProposeParamsResponse { } } /// MsgUpdateSafetyParams is the Msg/UpdateSafetyParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateSafetyParams { #[prost(string, tag = "1")] @@ -316,8 +301,7 @@ impl ::prost::Name for MsgUpdateSafetyParams { } } /// MsgUpdateSafetyParamsResponse is the Msg/UpdateSafetyParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateSafetyParamsResponse {} impl ::prost::Name for MsgUpdateSafetyParamsResponse { const NAME: &'static str = "MsgUpdateSafetyParamsResponse"; @@ -331,7 +315,13 @@ impl ::prost::Name for MsgUpdateSafetyParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -339,6 +329,7 @@ pub mod msg_client { 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 @@ -354,8 +345,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -380,7 +371,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -428,8 +419,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -456,8 +446,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -482,8 +471,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -508,8 +496,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -536,8 +523,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -555,8 +541,7 @@ pub mod msg_client { } } /// QueryEventParamsRequest is a request type for the EventParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryEventParamsRequest {} impl ::prost::Name for QueryEventParamsRequest { const NAME: &'static str = "QueryEventParamsRequest"; @@ -569,7 +554,6 @@ impl ::prost::Name for QueryEventParamsRequest { } } /// QueryEventParamsResponse is a response type for the EventParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEventParamsResponse { #[prost(message, optional, tag = "1")] @@ -586,8 +570,7 @@ impl ::prost::Name for QueryEventParamsResponse { } } /// QueryProposeParamsRequest is a request type for the ProposeParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryProposeParamsRequest {} impl ::prost::Name for QueryProposeParamsRequest { const NAME: &'static str = "QueryProposeParamsRequest"; @@ -601,8 +584,7 @@ impl ::prost::Name for QueryProposeParamsRequest { } /// QueryProposeParamsResponse is a response type for the ProposeParams RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryProposeParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, @@ -618,8 +600,7 @@ impl ::prost::Name for QueryProposeParamsResponse { } } /// QuerySafetyParamsRequest is a request type for the SafetyParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QuerySafetyParamsRequest {} impl ::prost::Name for QuerySafetyParamsRequest { const NAME: &'static str = "QuerySafetyParamsRequest"; @@ -632,8 +613,7 @@ impl ::prost::Name for QuerySafetyParamsRequest { } } /// QuerySafetyParamsResponse is a response type for the SafetyParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QuerySafetyParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, @@ -650,8 +630,7 @@ impl ::prost::Name for QuerySafetyParamsResponse { } /// QueryAcknowledgedEventInfoRequest is a request type for the /// AcknowledgedEventInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryAcknowledgedEventInfoRequest {} impl ::prost::Name for QueryAcknowledgedEventInfoRequest { const NAME: &'static str = "QueryAcknowledgedEventInfoRequest"; @@ -665,8 +644,7 @@ impl ::prost::Name for QueryAcknowledgedEventInfoRequest { } /// QueryAcknowledgedEventInfoResponse is a response type for the /// AcknowledgedEventInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryAcknowledgedEventInfoResponse { #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, @@ -683,8 +661,7 @@ impl ::prost::Name for QueryAcknowledgedEventInfoResponse { } /// QueryRecognizedEventInfoRequest is a request type for the /// RecognizedEventInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryRecognizedEventInfoRequest {} impl ::prost::Name for QueryRecognizedEventInfoRequest { const NAME: &'static str = "QueryRecognizedEventInfoRequest"; @@ -698,8 +675,7 @@ impl ::prost::Name for QueryRecognizedEventInfoRequest { } /// QueryRecognizedEventInfoResponse is a response type for the /// RecognizedEventInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryRecognizedEventInfoResponse { #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, @@ -716,7 +692,6 @@ impl ::prost::Name for QueryRecognizedEventInfoResponse { } /// QueryDelayedCompleteBridgeMessagesRequest is a request type for the /// DelayedCompleteBridgeMessages RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelayedCompleteBridgeMessagesRequest { #[prost(string, tag = "1")] @@ -734,7 +709,6 @@ impl ::prost::Name for QueryDelayedCompleteBridgeMessagesRequest { } /// QueryDelayedCompleteBridgeMessagesResponse is a response type for the /// DelayedCompleteBridgeMessages RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelayedCompleteBridgeMessagesResponse { #[prost(message, repeated, tag = "1")] @@ -753,7 +727,6 @@ impl ::prost::Name for QueryDelayedCompleteBridgeMessagesResponse { /// DelayedCompleteBridgeMessage is a message type for the response of /// DelayedCompleteBridgeMessages RPC method. It contains the message /// and the block height at which it will execute. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelayedCompleteBridgeMessage { #[prost(message, optional, tag = "1")] @@ -773,7 +746,13 @@ impl ::prost::Name for DelayedCompleteBridgeMessage { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -781,6 +760,7 @@ pub mod query_client { 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 @@ -796,8 +776,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -822,7 +802,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -869,8 +849,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -895,8 +874,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -921,8 +899,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -949,8 +926,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -979,8 +955,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1010,8 +985,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.clob.rs b/v4-proto-rs/src/dydxprotocol.clob.rs index c8c7008c1c..153301d78a 100644 --- a/v4-proto-rs/src/dydxprotocol.clob.rs +++ b/v4-proto-rs/src/dydxprotocol.clob.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Defines the block rate limits for CLOB specific operations. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockRateLimitConfiguration { /// How many short term order attempts (successful and failed) are allowed for @@ -61,8 +60,7 @@ impl ::prost::Name for BlockRateLimitConfiguration { } } /// Defines a rate limit over a specific number of blocks. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MaxPerNBlocksRateLimit { /// How many blocks the rate limit is over. /// Specifying 0 is invalid. @@ -85,8 +83,7 @@ impl ::prost::Name for MaxPerNBlocksRateLimit { } /// PerpetualClobMetadata contains metadata for a `ClobPair` /// representing a Perpetual product. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PerpetualClobMetadata { /// Id of the Perpetual the CLOB allows trading of. #[prost(uint32, tag = "1")] @@ -104,8 +101,7 @@ impl ::prost::Name for PerpetualClobMetadata { } /// PerpetualClobMetadata contains metadata for a `ClobPair` /// representing a Spot product. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SpotClobMetadata { /// Id of the base Asset in the trading pair. #[prost(uint32, tag = "1")] @@ -126,8 +122,7 @@ impl ::prost::Name for SpotClobMetadata { } /// ClobPair represents a single CLOB pair for a given product /// in state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ClobPair { /// ID of the orderbook that stores all resting liquidity for this CLOB. #[prost(uint32, tag = "1")] @@ -198,13 +193,13 @@ pub mod clob_pair { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Status::Unspecified => "STATUS_UNSPECIFIED", - Status::Active => "STATUS_ACTIVE", - Status::Paused => "STATUS_PAUSED", - Status::CancelOnly => "STATUS_CANCEL_ONLY", - Status::PostOnly => "STATUS_POST_ONLY", - Status::Initializing => "STATUS_INITIALIZING", - Status::FinalSettlement => "STATUS_FINAL_SETTLEMENT", + Self::Unspecified => "STATUS_UNSPECIFIED", + Self::Active => "STATUS_ACTIVE", + Self::Paused => "STATUS_PAUSED", + Self::CancelOnly => "STATUS_CANCEL_ONLY", + Self::PostOnly => "STATUS_POST_ONLY", + Self::Initializing => "STATUS_INITIALIZING", + Self::FinalSettlement => "STATUS_FINAL_SETTLEMENT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -223,8 +218,7 @@ pub mod clob_pair { } /// Product-specific metadata. Perpetual CLOBs will have /// PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Metadata { #[prost(message, tag = "2")] PerpetualClobMetadata(super::PerpetualClobMetadata), @@ -244,7 +238,6 @@ impl ::prost::Name for ClobPair { } /// Defines the set of equity tiers to limit how many open orders /// a subaccount is allowed to have. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EquityTierLimitConfiguration { /// How many short term stateful orders are allowed per equity tier. @@ -267,7 +260,6 @@ impl ::prost::Name for EquityTierLimitConfiguration { } } /// Defines an equity tier limit. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EquityTierLimit { /// The total net collateral in USDC quote quantums of equity required. @@ -287,9 +279,36 @@ impl ::prost::Name for EquityTierLimit { "/dydxprotocol.clob.EquityTierLimit".into() } } +/// ClobStagedFinalizeBlockEvent defines a CLOB event staged during +/// FinalizeBlock. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ClobStagedFinalizeBlockEvent { + /// event is the staged event. + #[prost(oneof = "clob_staged_finalize_block_event::Event", tags = "1")] + pub event: ::core::option::Option, +} +/// Nested message and enum types in `ClobStagedFinalizeBlockEvent`. +pub mod clob_staged_finalize_block_event { + /// event is the staged event. + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] + pub enum Event { + /// create_clob_pair indicates a new CLOB pair creation. + #[prost(message, tag = "1")] + CreateClobPair(super::ClobPair), + } +} +impl ::prost::Name for ClobStagedFinalizeBlockEvent { + const NAME: &'static str = "ClobStagedFinalizeBlockEvent"; + const PACKAGE: &'static str = "dydxprotocol.clob"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.clob.ClobStagedFinalizeBlockEvent".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.clob.ClobStagedFinalizeBlockEvent".into() + } +} /// LiquidationsConfig stores all configurable fields related to liquidations. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LiquidationsConfig { /// The maximum liquidation fee (in parts-per-million). This fee goes /// 100% to the insurance fund. @@ -320,8 +339,7 @@ impl ::prost::Name for LiquidationsConfig { } /// PositionBlockLimits stores all configurable fields related to limits /// around how much of a single position can be liquidated within a single block. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PositionBlockLimits { /// The minimum amount of quantums to liquidate for each message (in /// quote quantums). @@ -346,8 +364,7 @@ impl ::prost::Name for PositionBlockLimits { /// SubaccountBlockLimits stores all configurable fields related to limits /// around how many quote quantums from a single subaccount can /// be liquidated within a single block. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SubaccountBlockLimits { /// The maximum notional amount that a single subaccount can have /// liquidated (in quote quantums) per block. @@ -370,8 +387,7 @@ impl ::prost::Name for SubaccountBlockLimits { } /// FillablePriceConfig stores all configurable fields related to calculating /// the fillable price for liquidating a position. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FillablePriceConfig { /// The rate at which the Adjusted Bankruptcy Rating increases. #[prost(uint32, tag = "1")] @@ -392,7 +408,6 @@ impl ::prost::Name for FillablePriceConfig { } } /// GenesisState defines the clob module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] @@ -418,7 +433,6 @@ impl ::prost::Name for GenesisState { /// for a position held by a subaccount. /// Note this proto is defined to make it easier to hash /// the metadata of a liquidation, and is never written to state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualLiquidationInfo { /// The id of the subaccount that got liquidated/deleveraged or was deleveraged @@ -441,7 +455,6 @@ impl ::prost::Name for PerpetualLiquidationInfo { } /// SubaccountLiquidationInfo holds liquidation information per-subaccount in the /// current block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubaccountLiquidationInfo { /// An unsorted list of unique perpetual IDs that the subaccount has previously @@ -469,7 +482,6 @@ impl ::prost::Name for SubaccountLiquidationInfo { } /// SubaccountOpenPositionInfo holds information about open positions for a /// perpetual. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubaccountOpenPositionInfo { /// The id of the perpetual. @@ -497,7 +509,6 @@ impl ::prost::Name for SubaccountOpenPositionInfo { } } /// OrderId refers to a single order belonging to a Subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderId { /// The subaccount ID that opened this order. @@ -543,7 +554,6 @@ impl ::prost::Name for OrderId { } /// OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were /// filled by any non-zero amount in the latest block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrdersFilledDuringLatestBlock { /// A list of unique order_ids that were filled by any non-zero amount in the @@ -563,7 +573,6 @@ impl ::prost::Name for OrdersFilledDuringLatestBlock { } /// PotentiallyPrunableOrders represents a list of orders that may be prunable /// from state at a future block height. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PotentiallyPrunableOrders { /// A list of unique order_ids that may potentially be pruned from state at a @@ -585,8 +594,7 @@ impl ::prost::Name for PotentiallyPrunableOrders { /// state. This proto includes both the current on-chain fill amount of the /// order, as well as the block at which this information can be pruned from /// state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OrderFillState { /// The current fillAmount of the order according to on-chain state. #[prost(uint64, tag = "1")] @@ -614,7 +622,6 @@ impl ::prost::Name for OrderFillState { /// This `StatefulOrderTimeSliceValue` in state is used for managing stateful /// order expiration. Stateful order expirations can be for either long term /// or conditional orders. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatefulOrderTimeSliceValue { /// A unique list of order_ids that expire at this timestamp, sorted in @@ -636,7 +643,6 @@ impl ::prost::Name for StatefulOrderTimeSliceValue { /// LongTermOrderPlacement represents the placement of a stateful order in /// state. It stores the stateful order itself and the `BlockHeight` and /// `TransactionIndex` at which the order was placed. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LongTermOrderPlacement { #[prost(message, optional, tag = "1")] @@ -659,7 +665,6 @@ impl ::prost::Name for LongTermOrderPlacement { /// ConditionalOrderPlacement represents the placement of a conditional order in /// state. It stores the stateful order itself, the `BlockHeight` and /// `TransactionIndex` at which the order was placed and triggered. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConditionalOrderPlacement { #[prost(message, optional, tag = "1")] @@ -685,7 +690,6 @@ impl ::prost::Name for ConditionalOrderPlacement { } /// Order represents a single order belonging to a `Subaccount` /// for a particular `ClobPair`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Order { /// The unique ID of this order. Meant to be unique across all orders. @@ -763,9 +767,9 @@ pub mod order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Side::Unspecified => "SIDE_UNSPECIFIED", - Side::Buy => "SIDE_BUY", - Side::Sell => "SIDE_SELL", + Self::Unspecified => "SIDE_UNSPECIFIED", + Self::Buy => "SIDE_BUY", + Self::Sell => "SIDE_SELL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -807,9 +811,8 @@ pub mod order { /// any newly-placed post only orders that would cross with other maker /// orders. PostOnly = 2, - /// TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled - /// completely and immediately by maker orders on the book or canceled if the - /// entire amount can‘t be matched. + /// TIME_IN_FORCE_FILL_OR_KILL has been deprecated and will be removed in + /// future versions. FillOrKill = 3, } impl TimeInForce { @@ -819,10 +822,10 @@ pub mod order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - TimeInForce::Unspecified => "TIME_IN_FORCE_UNSPECIFIED", - TimeInForce::Ioc => "TIME_IN_FORCE_IOC", - TimeInForce::PostOnly => "TIME_IN_FORCE_POST_ONLY", - TimeInForce::FillOrKill => "TIME_IN_FORCE_FILL_OR_KILL", + Self::Unspecified => "TIME_IN_FORCE_UNSPECIFIED", + Self::Ioc => "TIME_IN_FORCE_IOC", + Self::PostOnly => "TIME_IN_FORCE_POST_ONLY", + Self::FillOrKill => "TIME_IN_FORCE_FILL_OR_KILL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -868,9 +871,9 @@ pub mod order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConditionType::Unspecified => "CONDITION_TYPE_UNSPECIFIED", - ConditionType::StopLoss => "CONDITION_TYPE_STOP_LOSS", - ConditionType::TakeProfit => "CONDITION_TYPE_TAKE_PROFIT", + Self::Unspecified => "CONDITION_TYPE_UNSPECIFIED", + Self::StopLoss => "CONDITION_TYPE_STOP_LOSS", + Self::TakeProfit => "CONDITION_TYPE_TAKE_PROFIT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -884,8 +887,7 @@ pub mod order { } } /// Information about when the order expires. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum GoodTilOneof { /// The last block this order can be executed at (after which it will be /// unfillable). Used only for Short-Term orders. If this value is non-zero @@ -916,8 +918,7 @@ impl ::prost::Name for Order { /// transaction was placed. This proto includes both block height and the /// transaction index that the specific transaction was placed. This information /// is used for ordering by time priority when the chain is restarted. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TransactionOrdering { /// Block height in which the transaction was placed. #[prost(uint32, tag = "1")] @@ -936,10 +937,41 @@ impl ::prost::Name for TransactionOrdering { "/dydxprotocol.clob.TransactionOrdering".into() } } +/// StreamLiquidationOrder represents an protocol-generated IOC liquidation +/// order. Used in full node streaming. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamLiquidationOrder { + /// Information about this liquidation order. + #[prost(message, optional, tag = "1")] + pub liquidation_info: ::core::option::Option, + /// CLOB pair ID of the CLOB pair the liquidation order will be matched + /// against. + #[prost(uint32, tag = "2")] + pub clob_pair_id: u32, + /// True if this is a buy order liquidating a short position, false if vice + /// versa. + #[prost(bool, tag = "3")] + pub is_buy: bool, + /// The number of base quantums for this liquidation order. + #[prost(uint64, tag = "4")] + pub quantums: u64, + /// The subticks this liquidation order will be submitted at. + #[prost(uint64, tag = "5")] + pub subticks: u64, +} +impl ::prost::Name for StreamLiquidationOrder { + const NAME: &'static str = "StreamLiquidationOrder"; + const PACKAGE: &'static str = "dydxprotocol.clob"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.clob.StreamLiquidationOrder".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.clob.StreamLiquidationOrder".into() + } +} /// ClobMatch represents an operations queue entry around all different types /// of matches, specifically regular matches, liquidation matches, and /// deleveraging matches. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClobMatch { /// The match type that this message includes. @@ -949,7 +981,6 @@ pub struct ClobMatch { /// Nested message and enum types in `ClobMatch`. pub mod clob_match { /// The match type that this message includes. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Match { #[prost(message, tag = "1")] @@ -971,7 +1002,6 @@ impl ::prost::Name for ClobMatch { } } /// MakerFill represents the filled amount of a matched maker order. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MakerFill { /// The filled amount of the matched maker order, in base quantums. @@ -993,7 +1023,6 @@ impl ::prost::Name for MakerFill { } } /// MatchOrders is an injected message used for matching orders. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MatchOrders { /// The `OrderId` of the taker order. @@ -1015,7 +1044,6 @@ impl ::prost::Name for MatchOrders { } /// MatchPerpetualLiquidation is an injected message used for liquidating a /// subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MatchPerpetualLiquidation { /// ID of the subaccount that was liquidated. @@ -1049,7 +1077,6 @@ impl ::prost::Name for MatchPerpetualLiquidation { } /// MatchPerpetualDeleveraging is an injected message used for deleveraging a /// subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MatchPerpetualDeleveraging { /// ID of the subaccount that was liquidated. @@ -1071,7 +1098,6 @@ pub struct MatchPerpetualDeleveraging { /// Nested message and enum types in `MatchPerpetualDeleveraging`. pub mod match_perpetual_deleveraging { /// Fill represents a fill between the liquidated and offsetting subaccount. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fill { /// ID of the subaccount that was used to offset the liquidated subaccount's @@ -1108,7 +1134,6 @@ impl ::prost::Name for MatchPerpetualDeleveraging { } } /// MEVMatch represents all necessary data to calculate MEV for a regular match. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MevMatch { #[prost(message, optional, tag = "1")] @@ -1144,7 +1169,6 @@ impl ::prost::Name for MevMatch { } /// MEVLiquidationMatch represents all necessary data to calculate MEV for a /// liquidation. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MevLiquidationMatch { #[prost(message, optional, tag = "1")] @@ -1179,8 +1203,7 @@ impl ::prost::Name for MevLiquidationMatch { } } /// ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ClobMidPrice { #[prost(message, optional, tag = "1")] pub clob_pair: ::core::option::Option, @@ -1199,7 +1222,6 @@ impl ::prost::Name for ClobMidPrice { } /// ValidatorMevMatches contains all matches from the validator's local /// operations queue. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorMevMatches { #[prost(message, repeated, tag = "1")] @@ -1219,7 +1241,6 @@ impl ::prost::Name for ValidatorMevMatches { } /// MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> /// node metrics. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MevNodeToNodeMetrics { #[prost(message, optional, tag = "1")] @@ -1242,7 +1263,6 @@ impl ::prost::Name for MevNodeToNodeMetrics { } } /// OrderRemoval is a request type used for forced removal of stateful orders. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderRemoval { #[prost(message, optional, tag = "1")] @@ -1302,6 +1322,9 @@ pub mod order_removal { /// REMOVAL_REASON_FULLY_FILLED represents a removal of an order that /// would lead to the subaccount violating isolated subaccount constraints. ViolatesIsolatedSubaccountConstraints = 8, + /// REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED represents a removal of an order + /// that was placed using an expired permissioned key. + PermissionedKeyExpired = 9, } impl RemovalReason { /// String value of the enum field names used in the ProtoBuf definition. @@ -1310,25 +1333,24 @@ pub mod order_removal { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RemovalReason::Unspecified => "REMOVAL_REASON_UNSPECIFIED", - RemovalReason::Undercollateralized => { - "REMOVAL_REASON_UNDERCOLLATERALIZED" - } - RemovalReason::InvalidReduceOnly => "REMOVAL_REASON_INVALID_REDUCE_ONLY", - RemovalReason::PostOnlyWouldCrossMakerOrder => { + Self::Unspecified => "REMOVAL_REASON_UNSPECIFIED", + Self::Undercollateralized => "REMOVAL_REASON_UNDERCOLLATERALIZED", + Self::InvalidReduceOnly => "REMOVAL_REASON_INVALID_REDUCE_ONLY", + Self::PostOnlyWouldCrossMakerOrder => { "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER" } - RemovalReason::InvalidSelfTrade => "REMOVAL_REASON_INVALID_SELF_TRADE", - RemovalReason::ConditionalFokCouldNotBeFullyFilled => { + Self::InvalidSelfTrade => "REMOVAL_REASON_INVALID_SELF_TRADE", + Self::ConditionalFokCouldNotBeFullyFilled => { "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED" } - RemovalReason::ConditionalIocWouldRestOnBook => { + Self::ConditionalIocWouldRestOnBook => { "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK" } - RemovalReason::FullyFilled => "REMOVAL_REASON_FULLY_FILLED", - RemovalReason::ViolatesIsolatedSubaccountConstraints => { + Self::FullyFilled => "REMOVAL_REASON_FULLY_FILLED", + Self::ViolatesIsolatedSubaccountConstraints => { "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS" } + Self::PermissionedKeyExpired => "REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1351,6 +1373,9 @@ pub mod order_removal { "REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS" => { Some(Self::ViolatesIsolatedSubaccountConstraints) } + "REMOVAL_REASON_PERMISSIONED_KEY_EXPIRED" => { + Some(Self::PermissionedKeyExpired) + } _ => None, } } @@ -1367,7 +1392,6 @@ impl ::prost::Name for OrderRemoval { } } /// MsgCreateClobPair is a message used by x/gov for creating a new clob pair. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClobPair { /// The address that controls the module. @@ -1388,8 +1412,7 @@ impl ::prost::Name for MsgCreateClobPair { } } /// MsgCreateClobPairResponse defines the CreateClobPair response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCreateClobPairResponse {} impl ::prost::Name for MsgCreateClobPairResponse { const NAME: &'static str = "MsgCreateClobPairResponse"; @@ -1403,7 +1426,6 @@ impl ::prost::Name for MsgCreateClobPairResponse { } /// MsgProposedOperations is a message injected by block proposers to /// specify the operations that occurred in a block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgProposedOperations { /// The list of operations proposed by the block proposer. @@ -1422,8 +1444,7 @@ impl ::prost::Name for MsgProposedOperations { } /// MsgProposedOperationsResponse is the response type of the message injected /// by block proposers to specify the operations that occurred in a block. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgProposedOperationsResponse {} impl ::prost::Name for MsgProposedOperationsResponse { const NAME: &'static str = "MsgProposedOperationsResponse"; @@ -1436,7 +1457,6 @@ impl ::prost::Name for MsgProposedOperationsResponse { } } /// MsgPlaceOrder is a request type used for placing orders. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPlaceOrder { #[prost(message, optional, tag = "1")] @@ -1453,8 +1473,7 @@ impl ::prost::Name for MsgPlaceOrder { } } /// MsgPlaceOrderResponse is a response type used for placing orders. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgPlaceOrderResponse {} impl ::prost::Name for MsgPlaceOrderResponse { const NAME: &'static str = "MsgPlaceOrderResponse"; @@ -1467,7 +1486,6 @@ impl ::prost::Name for MsgPlaceOrderResponse { } } /// MsgCancelOrder is a request type used for canceling orders. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelOrder { #[prost(message, optional, tag = "1")] @@ -1479,8 +1497,7 @@ pub struct MsgCancelOrder { /// Nested message and enum types in `MsgCancelOrder`. pub mod msg_cancel_order { /// Information about when the order cancellation expires. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum GoodTilOneof { /// The last block this order cancellation can be executed at. /// Used only for Short-Term orders and must be zero for stateful orders. @@ -1506,8 +1523,7 @@ impl ::prost::Name for MsgCancelOrder { } } /// MsgCancelOrderResponse is a response type used for canceling orders. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCancelOrderResponse {} impl ::prost::Name for MsgCancelOrderResponse { const NAME: &'static str = "MsgCancelOrderResponse"; @@ -1522,7 +1538,6 @@ impl ::prost::Name for MsgCancelOrderResponse { /// MsgBatchCancel is a request type used for batch canceling orders. /// This msg is not atomic. Cancels will be performed optimistically even /// if some cancels are invalid or fail. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBatchCancel { /// The subaccount this batch cancel will be applied for. @@ -1548,7 +1563,6 @@ impl ::prost::Name for MsgBatchCancel { /// OrderBatch represents a batch of orders all belonging to a single clob pair /// id. Along with a subaccount id and an order flag, is used to represent a /// batch of orders that share the same subaccount, order flag, and clob pair id. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderBatch { /// The Clob Pair ID all orders in this order batch belong to. @@ -1572,7 +1586,6 @@ impl ::prost::Name for OrderBatch { } /// MsgBatchCancelResponse is a response type used for batch canceling orders. /// It indicates which cancel orders have succeeded or failed. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBatchCancelResponse { /// A batch of short term cancel orders that have succeeded. @@ -1593,7 +1606,6 @@ impl ::prost::Name for MsgBatchCancelResponse { } } /// MsgUpdateClobPair is a request type used for updating a ClobPair in state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClobPair { /// Authority is the address that may send this message. @@ -1615,8 +1627,7 @@ impl ::prost::Name for MsgUpdateClobPair { } /// MsgUpdateClobPairResponse is a response type used for setting a ClobPair's /// status. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateClobPairResponse {} impl ::prost::Name for MsgUpdateClobPairResponse { const NAME: &'static str = "MsgUpdateClobPairResponse"; @@ -1630,7 +1641,6 @@ impl ::prost::Name for MsgUpdateClobPairResponse { } /// OperationRaw represents an operation in the proposed operations. /// Note that the `order_placement` operation is a signed message. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OperationRaw { /// operationRaw represents an operation that occurred, which can be a match, @@ -1642,7 +1652,6 @@ pub struct OperationRaw { pub mod operation_raw { /// operationRaw represents an operation that occurred, which can be a match, /// a signed order placement, or an order removal. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Operation { #[prost(message, tag = "1")] @@ -1665,7 +1674,6 @@ impl ::prost::Name for OperationRaw { } /// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration /// request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateEquityTierLimitConfiguration { #[prost(string, tag = "1")] @@ -1687,8 +1695,7 @@ impl ::prost::Name for MsgUpdateEquityTierLimitConfiguration { } /// MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration /// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateEquityTierLimitConfigurationResponse {} impl ::prost::Name for MsgUpdateEquityTierLimitConfigurationResponse { const NAME: &'static str = "MsgUpdateEquityTierLimitConfigurationResponse"; @@ -1702,7 +1709,6 @@ impl ::prost::Name for MsgUpdateEquityTierLimitConfigurationResponse { } /// MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration /// request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateBlockRateLimitConfiguration { #[prost(string, tag = "1")] @@ -1724,8 +1730,7 @@ impl ::prost::Name for MsgUpdateBlockRateLimitConfiguration { } /// MsgUpdateBlockRateLimitConfiguration is a response type for updating the /// liquidations config. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateBlockRateLimitConfigurationResponse {} impl ::prost::Name for MsgUpdateBlockRateLimitConfigurationResponse { const NAME: &'static str = "MsgUpdateBlockRateLimitConfigurationResponse"; @@ -1739,7 +1744,6 @@ impl ::prost::Name for MsgUpdateBlockRateLimitConfigurationResponse { } /// MsgUpdateLiquidationsConfig is a request type for updating the liquidations /// config. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateLiquidationsConfig { /// Authority is the address that may send this message. @@ -1761,8 +1765,7 @@ impl ::prost::Name for MsgUpdateLiquidationsConfig { } } /// MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateLiquidationsConfigResponse {} impl ::prost::Name for MsgUpdateLiquidationsConfigResponse { const NAME: &'static str = "MsgUpdateLiquidationsConfigResponse"; @@ -1776,7 +1779,13 @@ impl ::prost::Name for MsgUpdateLiquidationsConfigResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -1784,6 +1793,7 @@ pub mod msg_client { 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 @@ -1799,8 +1809,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1825,7 +1835,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -1873,8 +1883,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1899,8 +1908,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1925,8 +1933,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1951,8 +1958,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1977,8 +1983,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2006,8 +2011,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2035,8 +2039,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2067,8 +2070,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2098,8 +2100,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2118,7 +2119,6 @@ pub mod msg_client { } /// Operation represents an operation in the proposed operations. Operation is /// used internally within the memclob only. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Operation { /// operation represents the operation that occurred, which can be a match, @@ -2132,7 +2132,6 @@ pub mod operation { /// operation represents the operation that occurred, which can be a match, /// short term order placement, short term order cancellation, or the placement /// of a pre-existing stateful order. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Operation { #[prost(message, tag = "1")] @@ -2157,7 +2156,6 @@ impl ::prost::Name for Operation { } /// InternalOperation represents an internal operation in the operations to /// propose. InternalOperation is used internally within the memclob only. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InternalOperation { /// operation represents the operation that occurred, which can be a match, @@ -2171,7 +2169,6 @@ pub mod internal_operation { /// operation represents the operation that occurred, which can be a match, /// Short-Term order placement, or the placement of a pre-existing stateful /// order. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Operation { #[prost(message, tag = "1")] @@ -2205,21 +2202,23 @@ impl ::prost::Name for InternalOperation { /// - Conditional order IDs triggered in the last block. /// - Conditional order IDs placed, but not triggered in the last block. /// - The height of the block in which the events occurred. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProcessProposerMatchesEvents { + #[deprecated] #[prost(message, repeated, tag = "1")] pub placed_long_term_order_ids: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] pub expired_stateful_order_ids: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub order_ids_filled_in_last_block: ::prost::alloc::vec::Vec, + #[deprecated] #[prost(message, repeated, tag = "4")] pub placed_stateful_cancellation_order_ids: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "5")] pub removed_stateful_order_ids: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "6")] pub conditional_order_ids_triggered_in_last_block: ::prost::alloc::vec::Vec, + #[deprecated] #[prost(message, repeated, tag = "7")] pub placed_conditional_order_ids: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "8")] @@ -2236,8 +2235,7 @@ impl ::prost::Name for ProcessProposerMatchesEvents { } } /// QueryGetClobPairRequest is request type for the ClobPair method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryGetClobPairRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -2253,8 +2251,7 @@ impl ::prost::Name for QueryGetClobPairRequest { } } /// QueryClobPairResponse is response type for the ClobPair method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryClobPairResponse { #[prost(message, optional, tag = "1")] pub clob_pair: ::core::option::Option, @@ -2270,7 +2267,6 @@ impl ::prost::Name for QueryClobPairResponse { } } /// QueryAllClobPairRequest is request type for the ClobPairAll method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllClobPairRequest { #[prost(message, optional, tag = "1")] @@ -2289,7 +2285,6 @@ impl ::prost::Name for QueryAllClobPairRequest { } } /// QueryClobPairAllResponse is response type for the ClobPairAll method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClobPairAllResponse { #[prost(message, repeated, tag = "1")] @@ -2311,7 +2306,6 @@ impl ::prost::Name for QueryClobPairAllResponse { } /// MevNodeToNodeCalculationRequest is a request message used to run the /// MEV node <> node calculation. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MevNodeToNodeCalculationRequest { /// Represents the matches on the "block proposer". Note that this field @@ -2336,7 +2330,6 @@ impl ::prost::Name for MevNodeToNodeCalculationRequest { } /// MevNodeToNodeCalculationResponse is a response message that contains the /// MEV node <> node calculation result. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MevNodeToNodeCalculationResponse { #[prost(message, repeated, tag = "1")] @@ -2347,8 +2340,7 @@ pub struct MevNodeToNodeCalculationResponse { /// Nested message and enum types in `MevNodeToNodeCalculationResponse`. pub mod mev_node_to_node_calculation_response { /// MevAndVolumePerClob contains information about the MEV and volume per CLOB. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MevAndVolumePerClob { #[prost(uint32, tag = "1")] pub clob_pair_id: u32, @@ -2382,8 +2374,7 @@ impl ::prost::Name for MevNodeToNodeCalculationResponse { } /// QueryEquityTierLimitConfigurationRequest is a request message for /// EquityTierLimitConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryEquityTierLimitConfigurationRequest {} impl ::prost::Name for QueryEquityTierLimitConfigurationRequest { const NAME: &'static str = "QueryEquityTierLimitConfigurationRequest"; @@ -2397,7 +2388,6 @@ impl ::prost::Name for QueryEquityTierLimitConfigurationRequest { } /// QueryEquityTierLimitConfigurationResponse is a response message that contains /// the EquityTierLimitConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEquityTierLimitConfigurationResponse { #[prost(message, optional, tag = "1")] @@ -2415,8 +2405,7 @@ impl ::prost::Name for QueryEquityTierLimitConfigurationResponse { } /// QueryBlockRateLimitConfigurationRequest is a request message for /// BlockRateLimitConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryBlockRateLimitConfigurationRequest {} impl ::prost::Name for QueryBlockRateLimitConfigurationRequest { const NAME: &'static str = "QueryBlockRateLimitConfigurationRequest"; @@ -2430,7 +2419,6 @@ impl ::prost::Name for QueryBlockRateLimitConfigurationRequest { } /// QueryBlockRateLimitConfigurationResponse is a response message that contains /// the BlockRateLimitConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockRateLimitConfigurationResponse { #[prost(message, optional, tag = "1")] @@ -2447,7 +2435,6 @@ impl ::prost::Name for QueryBlockRateLimitConfigurationResponse { } } /// QueryStatefulOrderRequest is a request message for StatefulOrder. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryStatefulOrderRequest { /// Order id to query. @@ -2466,7 +2453,6 @@ impl ::prost::Name for QueryStatefulOrderRequest { } /// QueryStatefulOrderResponse is a response message that contains the stateful /// order. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryStatefulOrderResponse { /// Stateful order placement. @@ -2491,8 +2477,7 @@ impl ::prost::Name for QueryStatefulOrderResponse { } /// QueryLiquidationsConfigurationRequest is a request message for /// LiquidationsConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryLiquidationsConfigurationRequest {} impl ::prost::Name for QueryLiquidationsConfigurationRequest { const NAME: &'static str = "QueryLiquidationsConfigurationRequest"; @@ -2506,8 +2491,7 @@ impl ::prost::Name for QueryLiquidationsConfigurationRequest { } /// QueryLiquidationsConfigurationResponse is a response message that contains /// the LiquidationsConfiguration. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryLiquidationsConfigurationResponse { #[prost(message, optional, tag = "1")] pub liquidations_config: ::core::option::Option, @@ -2524,12 +2508,14 @@ impl ::prost::Name for QueryLiquidationsConfigurationResponse { } /// StreamOrderbookUpdatesRequest is a request message for the /// StreamOrderbookUpdates method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOrderbookUpdatesRequest { /// Clob pair ids to stream orderbook updates for. #[prost(uint32, repeated, tag = "1")] pub clob_pair_id: ::prost::alloc::vec::Vec, + /// Subaccount ids to stream subaccount updates for. + #[prost(message, repeated, tag = "2")] + pub subaccount_ids: ::prost::alloc::vec::Vec, } impl ::prost::Name for StreamOrderbookUpdatesRequest { const NAME: &'static str = "StreamOrderbookUpdatesRequest"; @@ -2543,19 +2529,11 @@ impl ::prost::Name for StreamOrderbookUpdatesRequest { } /// StreamOrderbookUpdatesResponse is a response message for the /// StreamOrderbookUpdates method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOrderbookUpdatesResponse { - /// Orderbook updates for the clob pair. + /// Batch of updates for the clob pair. #[prost(message, repeated, tag = "1")] pub updates: ::prost::alloc::vec::Vec, - /// ---Additional fields used to debug issues--- - /// Block height of the updates. - #[prost(uint32, tag = "2")] - pub block_height: u32, - /// Exec mode of the updates. - #[prost(uint32, tag = "3")] - pub exec_mode: u32, } impl ::prost::Name for StreamOrderbookUpdatesResponse { const NAME: &'static str = "StreamOrderbookUpdatesResponse"; @@ -2569,25 +2547,33 @@ impl ::prost::Name for StreamOrderbookUpdatesResponse { } /// StreamUpdate is an update that will be pushed through the /// GRPC stream. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamUpdate { + /// Block height of the update. + #[prost(uint32, tag = "1")] + pub block_height: u32, + /// Exec mode of the update. + #[prost(uint32, tag = "2")] + pub exec_mode: u32, /// Contains one of an StreamOrderbookUpdate, - /// StreamOrderbookFill. - #[prost(oneof = "stream_update::UpdateMessage", tags = "1, 2")] + /// StreamOrderbookFill, StreamTakerOrderStatus. + #[prost(oneof = "stream_update::UpdateMessage", tags = "3, 4, 5, 6")] pub update_message: ::core::option::Option, } /// Nested message and enum types in `StreamUpdate`. pub mod stream_update { /// Contains one of an StreamOrderbookUpdate, - /// StreamOrderbookFill. - #[allow(clippy::derive_partial_eq_without_eq)] + /// StreamOrderbookFill, StreamTakerOrderStatus. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum UpdateMessage { - #[prost(message, tag = "1")] + #[prost(message, tag = "3")] OrderbookUpdate(super::StreamOrderbookUpdate), - #[prost(message, tag = "2")] + #[prost(message, tag = "4")] OrderFill(super::StreamOrderbookFill), + #[prost(message, tag = "5")] + TakerOrder(super::StreamTakerOrder), + #[prost(message, tag = "6")] + SubaccountUpdate(super::super::subaccounts::StreamSubaccountUpdate), } } impl ::prost::Name for StreamUpdate { @@ -2602,21 +2588,20 @@ impl ::prost::Name for StreamUpdate { } /// StreamOrderbookUpdate provides information on an orderbook update. Used in /// the full node GRPC stream. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOrderbookUpdate { + /// Snapshot indicates if the response is from a snapshot of the orderbook. + /// All updates should be ignored until snapshot is recieved. + /// If the snapshot is true, then all previous entries should be + /// discarded and the orderbook should be resynced. + #[prost(bool, tag = "1")] + pub snapshot: bool, /// Orderbook updates for the clob pair. Can contain order place, removals, /// or updates. - #[prost(message, repeated, tag = "1")] + #[prost(message, repeated, tag = "2")] pub updates: ::prost::alloc::vec::Vec< super::indexer::off_chain_updates::OffChainUpdateV1, >, - /// Snapshot indicates if the response is from a snapshot of the orderbook. - /// This is true for the initial response and false for all subsequent updates. - /// Note that if the snapshot is true, then all previous entries should be - /// discarded and the orderbook should be resynced. - #[prost(bool, tag = "2")] - pub snapshot: bool, } impl ::prost::Name for StreamOrderbookUpdate { const NAME: &'static str = "StreamOrderbookUpdate"; @@ -2630,11 +2615,10 @@ impl ::prost::Name for StreamOrderbookUpdate { } /// StreamOrderbookFill provides information on an orderbook fill. Used in /// the full node GRPC stream. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOrderbookFill { /// Clob match. Provides information on which orders were matched - /// and the type of order. Fill amounts here are relative. + /// and the type of order. #[prost(message, optional, tag = "1")] pub clob_match: ::core::option::Option, /// All orders involved in the specified clob match. Used to look up @@ -2642,7 +2626,7 @@ pub struct StreamOrderbookFill { #[prost(message, repeated, tag = "2")] pub orders: ::prost::alloc::vec::Vec, /// Resulting fill amounts for each order in the orders array. - #[prost(uint64, repeated, packed = "false", tag = "3")] + #[prost(uint64, repeated, tag = "3")] pub fill_amounts: ::prost::alloc::vec::Vec, } impl ::prost::Name for StreamOrderbookFill { @@ -2655,9 +2639,82 @@ impl ::prost::Name for StreamOrderbookFill { "/dydxprotocol.clob.StreamOrderbookFill".into() } } +/// StreamTakerOrder provides information on a taker order that was attempted +/// to be matched on the orderbook. +/// It is intended to be used only in full node streaming. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamTakerOrder { + /// Information on the taker order after it is matched on the book, + /// either successfully or unsuccessfully. + #[prost(message, optional, tag = "3")] + pub taker_order_status: ::core::option::Option, + /// The taker order that was matched on the orderbook. Can be a + /// regular order or a liquidation order. + #[prost(oneof = "stream_taker_order::TakerOrder", tags = "1, 2")] + pub taker_order: ::core::option::Option, +} +/// Nested message and enum types in `StreamTakerOrder`. +pub mod stream_taker_order { + /// The taker order that was matched on the orderbook. Can be a + /// regular order or a liquidation order. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum TakerOrder { + #[prost(message, tag = "1")] + Order(super::Order), + #[prost(message, tag = "2")] + LiquidationOrder(super::StreamLiquidationOrder), + } +} +impl ::prost::Name for StreamTakerOrder { + const NAME: &'static str = "StreamTakerOrder"; + const PACKAGE: &'static str = "dydxprotocol.clob"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.clob.StreamTakerOrder".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.clob.StreamTakerOrder".into() + } +} +/// StreamTakerOrderStatus is a representation of a taker order +/// after it is attempted to be matched on the orderbook. +/// It is intended to be used only in full node streaming. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct StreamTakerOrderStatus { + /// The state of the taker order after attempting to match it against the + /// orderbook. Possible enum values can be found here: + /// + #[prost(uint32, tag = "1")] + pub order_status: u32, + /// The amount of remaining (non-matched) base quantums of this taker order. + #[prost(uint64, tag = "2")] + pub remaining_quantums: u64, + /// The amount of base quantums that were *optimistically* filled for this + /// taker order when the order is matched against the orderbook. Note that if + /// any quantums of this order were optimistically filled or filled in state + /// before this invocation of the matching loop, this value will not include + /// them. + #[prost(uint64, tag = "3")] + pub optimistically_filled_quantums: u64, +} +impl ::prost::Name for StreamTakerOrderStatus { + const NAME: &'static str = "StreamTakerOrderStatus"; + const PACKAGE: &'static str = "dydxprotocol.clob"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.clob.StreamTakerOrderStatus".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.clob.StreamTakerOrderStatus".into() + } +} /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -2665,6 +2722,7 @@ pub mod query_client { 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 @@ -2680,8 +2738,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -2706,7 +2764,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -2753,8 +2811,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2779,8 +2836,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2805,8 +2861,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2838,8 +2893,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2871,8 +2925,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2904,8 +2957,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2935,8 +2987,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2964,8 +3015,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -2982,3 +3032,33 @@ pub mod query_client { } } } +/// StagedFinalizeBlockEvent is an event staged during `FinalizeBlock`. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StagedFinalizeBlockEvent { + /// Contains one of StreamOrderbookFill, StreamSubaccountUpdate. + #[prost(oneof = "staged_finalize_block_event::Event", tags = "1, 2, 3")] + pub event: ::core::option::Option, +} +/// Nested message and enum types in `StagedFinalizeBlockEvent`. +pub mod staged_finalize_block_event { + /// Contains one of StreamOrderbookFill, StreamSubaccountUpdate. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Event { + #[prost(message, tag = "1")] + OrderFill(super::StreamOrderbookFill), + #[prost(message, tag = "2")] + SubaccountUpdate(super::super::subaccounts::StreamSubaccountUpdate), + #[prost(message, tag = "3")] + OrderbookUpdate(super::StreamOrderbookUpdate), + } +} +impl ::prost::Name for StagedFinalizeBlockEvent { + const NAME: &'static str = "StagedFinalizeBlockEvent"; + const PACKAGE: &'static str = "dydxprotocol.clob"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.clob.StagedFinalizeBlockEvent".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.clob.StagedFinalizeBlockEvent".into() + } +} diff --git a/v4-proto-rs/src/dydxprotocol.daemons.bridge.rs b/v4-proto-rs/src/dydxprotocol.daemons.bridge.rs index ae7eb45729..fccaa51697 100644 --- a/v4-proto-rs/src/dydxprotocol.daemons.bridge.rs +++ b/v4-proto-rs/src/dydxprotocol.daemons.bridge.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// AddBridgeEventsRequest is a request message that contains a list of new /// bridge events. The events should be contiguous and sorted by (unique) id. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddBridgeEventsRequest { #[prost(message, repeated, tag = "1")] @@ -18,8 +17,7 @@ impl ::prost::Name for AddBridgeEventsRequest { } } /// AddBridgeEventsResponse is a response message for BridgeEventRequest. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AddBridgeEventsResponse {} impl ::prost::Name for AddBridgeEventsResponse { const NAME: &'static str = "AddBridgeEventsResponse"; @@ -33,7 +31,13 @@ impl ::prost::Name for AddBridgeEventsResponse { } /// Generated client implementations. pub mod bridge_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// BridgeService defines the gRPC service used by bridge daemon. @@ -41,6 +45,7 @@ pub mod bridge_service_client { pub struct BridgeServiceClient { inner: tonic::client::Grpc, } + #[cfg(feature = "grpc-transport")] impl BridgeServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result @@ -56,8 +61,8 @@ pub mod bridge_service_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -82,7 +87,7 @@ pub mod bridge_service_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { BridgeServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -129,8 +134,7 @@ pub mod bridge_service_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.daemons.liquidation.rs b/v4-proto-rs/src/dydxprotocol.daemons.liquidation.rs index b87a3eed41..b51725814b 100644 --- a/v4-proto-rs/src/dydxprotocol.daemons.liquidation.rs +++ b/v4-proto-rs/src/dydxprotocol.daemons.liquidation.rs @@ -3,7 +3,6 @@ /// subaccount ids that potentially need to be liquidated. The list of subaccount /// ids should not contain duplicates. The application should re-verify these /// subaccount ids against current state before liquidating their positions. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LiquidateSubaccountsRequest { /// The block height at which the liquidation daemon is processing. @@ -37,8 +36,7 @@ impl ::prost::Name for LiquidateSubaccountsRequest { } /// LiquidateSubaccountsResponse is a response message for /// LiquidateSubaccountsRequest. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LiquidateSubaccountsResponse {} impl ::prost::Name for LiquidateSubaccountsResponse { const NAME: &'static str = "LiquidateSubaccountsResponse"; @@ -52,7 +50,13 @@ impl ::prost::Name for LiquidateSubaccountsResponse { } /// Generated client implementations. pub mod liquidation_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// LiquidationService defines the gRPC service used by liquidation daemon. @@ -60,6 +64,7 @@ pub mod liquidation_service_client { pub struct LiquidationServiceClient { inner: tonic::client::Grpc, } + #[cfg(feature = "grpc-transport")] impl LiquidationServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result @@ -75,8 +80,8 @@ pub mod liquidation_service_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -101,7 +106,7 @@ pub mod liquidation_service_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { LiquidationServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -148,8 +153,7 @@ pub mod liquidation_service_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.daemons.pricefeed.rs b/v4-proto-rs/src/dydxprotocol.daemons.pricefeed.rs index bb273d7232..c8f9553adf 100644 --- a/v4-proto-rs/src/dydxprotocol.daemons.pricefeed.rs +++ b/v4-proto-rs/src/dydxprotocol.daemons.pricefeed.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// UpdateMarketPriceRequest is a request message updating market prices. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateMarketPricesRequest { #[prost(message, repeated, tag = "1")] @@ -17,8 +16,7 @@ impl ::prost::Name for UpdateMarketPricesRequest { } } /// UpdateMarketPricesResponse is a response message for updating market prices. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateMarketPricesResponse {} impl ::prost::Name for UpdateMarketPricesResponse { const NAME: &'static str = "UpdateMarketPricesResponse"; @@ -31,7 +29,6 @@ impl ::prost::Name for UpdateMarketPricesResponse { } } /// ExchangePrice represents a specific exchange's market price -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExchangePrice { #[prost(string, tag = "1")] @@ -52,7 +49,6 @@ impl ::prost::Name for ExchangePrice { } } /// MarketPriceUpdate represents an update to a single market -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketPriceUpdate { #[prost(uint32, tag = "1")] @@ -72,7 +68,13 @@ impl ::prost::Name for MarketPriceUpdate { } /// Generated client implementations. pub mod price_feed_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// PriceFeedService provides methods related to market prices. @@ -80,6 +82,7 @@ pub mod price_feed_service_client { pub struct PriceFeedServiceClient { inner: tonic::client::Grpc, } + #[cfg(feature = "grpc-transport")] impl PriceFeedServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result @@ -95,8 +98,8 @@ pub mod price_feed_service_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -121,7 +124,7 @@ pub mod price_feed_service_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { PriceFeedServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -168,8 +171,7 @@ pub mod price_feed_service_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.delaymsg.rs b/v4-proto-rs/src/dydxprotocol.delaymsg.rs index b4e043a63f..ee9ac13c75 100644 --- a/v4-proto-rs/src/dydxprotocol.delaymsg.rs +++ b/v4-proto-rs/src/dydxprotocol.delaymsg.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// BlockMessageIds stores the id of each message that should be processed at a /// given block height. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockMessageIds { /// ids stores a list of DelayedMessage ids that should be processed at a given @@ -20,7 +19,6 @@ impl ::prost::Name for BlockMessageIds { } } /// DelayedMessage is a message that is delayed until a certain block height. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelayedMessage { /// The ID of the delayed message. @@ -44,7 +42,6 @@ impl ::prost::Name for DelayedMessage { } } /// GenesisState defines the delaymsg module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// delayed_messages is a list of delayed messages. @@ -66,8 +63,7 @@ impl ::prost::Name for GenesisState { } /// QueryNextDelayedMessageIdRequest is the request type for the /// NextDelayedMessageId RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryNextDelayedMessageIdRequest {} impl ::prost::Name for QueryNextDelayedMessageIdRequest { const NAME: &'static str = "QueryNextDelayedMessageIdRequest"; @@ -81,8 +77,7 @@ impl ::prost::Name for QueryNextDelayedMessageIdRequest { } /// QueryNextDelayedMessageIdResponse is the response type for the /// NextDelayedMessageId RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryNextDelayedMessageIdResponse { #[prost(uint32, tag = "1")] pub next_delayed_message_id: u32, @@ -98,8 +93,7 @@ impl ::prost::Name for QueryNextDelayedMessageIdResponse { } } /// QueryMessageRequest is the request type for the Message RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryMessageRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -115,7 +109,6 @@ impl ::prost::Name for QueryMessageRequest { } } /// QueryGetMessageResponse is the response type for the Message RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryMessageResponse { #[prost(message, optional, tag = "1")] @@ -133,8 +126,7 @@ impl ::prost::Name for QueryMessageResponse { } /// QueryBlockMessageIdsRequest is the request type for the BlockMessageIds /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryBlockMessageIdsRequest { #[prost(uint32, tag = "1")] pub block_height: u32, @@ -151,7 +143,6 @@ impl ::prost::Name for QueryBlockMessageIdsRequest { } /// QueryGetBlockMessageIdsResponse is the response type for the BlockMessageIds /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockMessageIdsResponse { #[prost(uint32, repeated, tag = "1")] @@ -169,7 +160,13 @@ impl ::prost::Name for QueryBlockMessageIdsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -177,6 +174,7 @@ pub mod query_client { 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 @@ -192,8 +190,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -218,7 +216,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -265,8 +263,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -296,8 +293,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -322,8 +318,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -341,7 +336,6 @@ pub mod query_client { } } /// MsgDelayMessage is a request type for the DelayMessage method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelayMessage { #[prost(string, tag = "1")] @@ -364,8 +358,7 @@ impl ::prost::Name for MsgDelayMessage { } } /// MsgDelayMessageResponse is a response type for the DelayMessage method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDelayMessageResponse { /// The id of the created delayed message. #[prost(uint64, tag = "1")] @@ -383,7 +376,13 @@ impl ::prost::Name for MsgDelayMessageResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -391,6 +390,7 @@ pub mod msg_client { 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 @@ -406,8 +406,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -432,7 +432,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -480,8 +480,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.epochs.rs b/v4-proto-rs/src/dydxprotocol.epochs.rs index b586a436c1..c1205ef717 100644 --- a/v4-proto-rs/src/dydxprotocol.epochs.rs +++ b/v4-proto-rs/src/dydxprotocol.epochs.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// EpochInfo stores metadata of an epoch timer. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EpochInfo { /// name is the unique identifier. @@ -51,7 +50,6 @@ impl ::prost::Name for EpochInfo { } } /// GenesisState defines the epochs module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// this line is used by starport scaffolding # genesis/proto/state @@ -69,7 +67,6 @@ impl ::prost::Name for GenesisState { } } /// QueryGetEpochInfoRequest is request type for the GetEpochInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGetEpochInfoRequest { #[prost(string, tag = "1")] @@ -86,7 +83,6 @@ impl ::prost::Name for QueryGetEpochInfoRequest { } } /// QueryEpochInfoResponse is response type for the GetEpochInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEpochInfoResponse { #[prost(message, optional, tag = "1")] @@ -103,7 +99,6 @@ impl ::prost::Name for QueryEpochInfoResponse { } } /// QueryAllEpochInfoRequest is request type for the AllEpochInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEpochInfoRequest { #[prost(message, optional, tag = "1")] @@ -122,7 +117,6 @@ impl ::prost::Name for QueryAllEpochInfoRequest { } } /// QueryEpochInfoAllResponse is response type for the AllEpochInfo RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEpochInfoAllResponse { #[prost(message, repeated, tag = "1")] @@ -144,7 +138,13 @@ impl ::prost::Name for QueryEpochInfoAllResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -152,6 +152,7 @@ pub mod query_client { 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 @@ -167,8 +168,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -193,7 +194,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -240,8 +241,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -266,8 +266,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.feetiers.rs b/v4-proto-rs/src/dydxprotocol.feetiers.rs index 36aa2256ae..1fd082bb1e 100644 --- a/v4-proto-rs/src/dydxprotocol.feetiers.rs +++ b/v4-proto-rs/src/dydxprotocol.feetiers.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// PerpetualFeeParams defines the parameters for perpetual fees. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualFeeParams { /// Sorted fee tiers (lowest requirements first). @@ -18,7 +17,6 @@ impl ::prost::Name for PerpetualFeeParams { } } /// A fee tier for perpetuals -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualFeeTier { /// Human-readable name of the tier, e.g. "Gold". @@ -51,7 +49,6 @@ impl ::prost::Name for PerpetualFeeTier { } } /// GenesisState defines the feetiers module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// The parameters for perpetual fees. @@ -70,8 +67,7 @@ impl ::prost::Name for GenesisState { } /// QueryPerpetualFeeParamsRequest is a request type for the PerpetualFeeParams /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPerpetualFeeParamsRequest {} impl ::prost::Name for QueryPerpetualFeeParamsRequest { const NAME: &'static str = "QueryPerpetualFeeParamsRequest"; @@ -85,7 +81,6 @@ impl ::prost::Name for QueryPerpetualFeeParamsRequest { } /// QueryPerpetualFeeParamsResponse is a response type for the PerpetualFeeParams /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPerpetualFeeParamsResponse { #[prost(message, optional, tag = "1")] @@ -102,7 +97,6 @@ impl ::prost::Name for QueryPerpetualFeeParamsResponse { } } /// QueryUserFeeTierRequest is a request type for the UserFeeTier RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUserFeeTierRequest { #[prost(string, tag = "1")] @@ -119,7 +113,6 @@ impl ::prost::Name for QueryUserFeeTierRequest { } } /// QueryUserFeeTierResponse is a request type for the UserFeeTier RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUserFeeTierResponse { /// Index of the fee tier in the list queried from PerpetualFeeParams. @@ -140,7 +133,13 @@ impl ::prost::Name for QueryUserFeeTierResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -148,6 +147,7 @@ pub mod query_client { 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 @@ -163,8 +163,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -189,7 +189,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -236,8 +236,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -264,8 +263,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -281,7 +279,6 @@ pub mod query_client { } } /// MsgUpdatePerpetualFeeParams is the Msg/UpdatePerpetualFeeParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdatePerpetualFeeParams { #[prost(string, tag = "1")] @@ -302,8 +299,7 @@ impl ::prost::Name for MsgUpdatePerpetualFeeParams { } /// MsgUpdatePerpetualFeeParamsResponse is the Msg/UpdatePerpetualFeeParams /// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdatePerpetualFeeParamsResponse {} impl ::prost::Name for MsgUpdatePerpetualFeeParamsResponse { const NAME: &'static str = "MsgUpdatePerpetualFeeParamsResponse"; @@ -317,7 +313,13 @@ impl ::prost::Name for MsgUpdatePerpetualFeeParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -325,6 +327,7 @@ pub mod msg_client { 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 @@ -340,8 +343,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -366,7 +369,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -413,8 +416,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.govplus.rs b/v4-proto-rs/src/dydxprotocol.govplus.rs index 3d9b4e7aed..2c1b3b58a9 100644 --- a/v4-proto-rs/src/dydxprotocol.govplus.rs +++ b/v4-proto-rs/src/dydxprotocol.govplus.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// GenesisState defines the govplus module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GenesisState {} impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; @@ -15,7 +14,13 @@ impl ::prost::Name for GenesisState { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -23,6 +28,7 @@ pub mod query_client { 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 @@ -38,8 +44,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -64,7 +70,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -102,7 +108,6 @@ pub mod query_client { } } /// MsgSlashValidator is the Msg/SlashValidator request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSlashValidator { #[prost(string, tag = "1")] @@ -145,8 +150,7 @@ impl ::prost::Name for MsgSlashValidator { } } /// MsgSlashValidatorResponse is the Msg/SlashValidator response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSlashValidatorResponse {} impl ::prost::Name for MsgSlashValidatorResponse { const NAME: &'static str = "MsgSlashValidatorResponse"; @@ -160,7 +164,13 @@ impl ::prost::Name for MsgSlashValidatorResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -168,6 +178,7 @@ pub mod msg_client { 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 @@ -183,8 +194,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -209,7 +220,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -257,8 +268,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.indexer.events.rs b/v4-proto-rs/src/dydxprotocol.indexer.events.rs index a613801c76..84c643dcc6 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.events.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.events.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// FundingUpdate is used for funding update events and includes a funding /// value and an optional funding index that correspond to a perpetual market. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FundingUpdateV1 { /// The id of the perpetual market. @@ -35,7 +34,6 @@ impl ::prost::Name for FundingUpdateV1 { /// 3. Funding rate and index: final funding rate combining all premium samples /// during a `funding-tick` epoch and funding index accordingly updated with /// `funding rate * price`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FundingEventV1 { /// updates is a list of per-market funding updates for all existing perpetual @@ -81,10 +79,10 @@ pub mod funding_event_v1 { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Type::Unspecified => "TYPE_UNSPECIFIED", - Type::PremiumSample => "TYPE_PREMIUM_SAMPLE", - Type::FundingRateAndIndex => "TYPE_FUNDING_RATE_AND_INDEX", - Type::PremiumVote => "TYPE_PREMIUM_VOTE", + Self::Unspecified => "TYPE_UNSPECIFIED", + Self::PremiumSample => "TYPE_PREMIUM_SAMPLE", + Self::FundingRateAndIndex => "TYPE_FUNDING_RATE_AND_INDEX", + Self::PremiumVote => "TYPE_PREMIUM_VOTE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -111,7 +109,6 @@ impl ::prost::Name for FundingEventV1 { } /// MarketEvent message contains all the information about a market event on /// the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketEventV1 { /// market id. @@ -124,7 +121,6 @@ pub struct MarketEventV1 { /// Nested message and enum types in `MarketEventV1`. pub mod market_event_v1 { /// either an event for price update, market creation, or market modification. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { #[prost(message, tag = "2")] @@ -147,8 +143,7 @@ impl ::prost::Name for MarketEventV1 { } /// MarketPriceUpdateEvent message contains all the information about a price /// update on the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MarketPriceUpdateEventV1 { /// price_with_exponent. Multiply by 10 ^ Exponent to get the human readable /// price in dollars. For example if `Exponent == -5` then a `exponent_price` @@ -167,7 +162,6 @@ impl ::prost::Name for MarketPriceUpdateEventV1 { } } /// shared fields between MarketCreateEvent and MarketModifyEvent -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketBaseEventV1 { /// String representation of the market pair, e.g. `BTC-USD` @@ -190,7 +184,6 @@ impl ::prost::Name for MarketBaseEventV1 { } /// MarketCreateEvent message contains all the information about a new market on /// the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketCreateEventV1 { #[prost(message, optional, tag = "1")] @@ -214,7 +207,6 @@ impl ::prost::Name for MarketCreateEventV1 { } /// MarketModifyEvent message contains all the information about a market update /// on the dYdX chain -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketModifyEventV1 { #[prost(message, optional, tag = "1")] @@ -231,7 +223,6 @@ impl ::prost::Name for MarketModifyEventV1 { } } /// SourceOfFunds is the source of funds in a transfer event. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SourceOfFunds { /// one of below @@ -245,7 +236,6 @@ pub mod source_of_funds { /// one of below /// - a subaccount ID /// - a wallet address - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Source { #[prost(message, tag = "1")] @@ -268,7 +258,6 @@ impl ::prost::Name for SourceOfFunds { /// deposit-to-subaccount, or withdraw-from-subaccount on the dYdX chain. /// When a subaccount is involved, a SubaccountUpdateEvent message will /// be produced with the updated asset positions. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferEventV1 { #[prost(message, optional, tag = "1")] @@ -309,7 +298,6 @@ impl ::prost::Name for TransferEventV1 { /// OrderFillEvent message contains all the information from an order match in /// the dYdX chain. This includes the maker/taker orders that matched and the /// amount filled. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderFillEventV1 { #[prost(message, optional, tag = "1")] @@ -330,6 +318,9 @@ pub struct OrderFillEventV1 { /// Total filled of the taker order in base quantums. #[prost(uint64, tag = "8")] pub total_filled_taker: u64, + /// rev share for affiliates in USDC quantums. + #[prost(uint64, tag = "9")] + pub affiliate_rev_share: u64, /// The type of order fill this event represents. #[prost(oneof = "order_fill_event_v1::TakerOrder", tags = "2, 4")] pub taker_order: ::core::option::Option, @@ -337,7 +328,6 @@ pub struct OrderFillEventV1 { /// Nested message and enum types in `OrderFillEventV1`. pub mod order_fill_event_v1 { /// The type of order fill this event represents. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum TakerOrder { #[prost(message, tag = "2")] @@ -359,7 +349,6 @@ impl ::prost::Name for OrderFillEventV1 { /// DeleveragingEvent message contains all the information for a deleveraging /// on the dYdX chain. This includes the liquidated/offsetting subaccounts and /// the amount filled. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleveragingEventV1 { /// ID of the subaccount that was liquidated. @@ -400,7 +389,6 @@ impl ::prost::Name for DeleveragingEventV1 { } /// LiquidationOrder represents the liquidation taker order to be included in a /// liquidation order fill event. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LiquidationOrderV1 { /// ID of the subaccount that was liquidated. @@ -443,7 +431,6 @@ impl ::prost::Name for LiquidationOrderV1 { /// Note: This event message will contain all the updates to a subaccount /// at the end of a block which is why multiple asset/perpetual position /// updates may exist. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubaccountUpdateEventV1 { #[prost(message, optional, tag = "1")] @@ -473,7 +460,6 @@ impl ::prost::Name for SubaccountUpdateEventV1 { /// order. Currently, this is either the placement of a long-term order, the /// placement or triggering of a conditional order, or the removal of a /// stateful order. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatefulOrderEventV1 { /// The type of event that this StatefulOrderEvent contains. @@ -484,7 +470,6 @@ pub struct StatefulOrderEventV1 { pub mod stateful_order_event_v1 { /// A stateful order placement contains an order. /// Deprecated in favor of LongTermOrderPlacementV1. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatefulOrderPlacementV1 { #[prost(message, optional, tag = "1")] @@ -504,7 +489,6 @@ pub mod stateful_order_event_v1 { } /// A stateful order removal contains the id of an order that was already /// placed and is now removed and the reason for the removal. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatefulOrderRemovalV1 { #[prost(message, optional, tag = "1")] @@ -528,7 +512,6 @@ pub mod stateful_order_event_v1 { } /// A conditional order placement contains an order. The order is newly-placed /// and untriggered when this event is emitted. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConditionalOrderPlacementV1 { #[prost(message, optional, tag = "1")] @@ -548,7 +531,6 @@ pub mod stateful_order_event_v1 { } /// A conditional order trigger event contains an order id and is emitted when /// an order is triggered. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConditionalOrderTriggeredV1 { #[prost(message, optional, tag = "1")] @@ -569,7 +551,6 @@ pub mod stateful_order_event_v1 { } } /// A long term order placement contains an order. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LongTermOrderPlacementV1 { #[prost(message, optional, tag = "1")] @@ -587,11 +568,15 @@ pub mod stateful_order_event_v1 { .into() } } - /// A long term order placement contains an order. - #[allow(clippy::derive_partial_eq_without_eq)] + /// A long term order replacement contains an old order ID and the new order. #[derive(Clone, PartialEq, ::prost::Message)] pub struct LongTermOrderReplacementV1 { + /// vault replaces orders with a different order ID #[prost(message, optional, tag = "1")] + pub old_order_id: ::core::option::Option< + super::super::protocol::v1::IndexerOrderId, + >, + #[prost(message, optional, tag = "2")] pub order: ::core::option::Option, } impl ::prost::Name for LongTermOrderReplacementV1 { @@ -607,7 +592,6 @@ pub mod stateful_order_event_v1 { } } /// The type of event that this StatefulOrderEvent contains. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { /// Deprecated in favor of long_term_order_placement @@ -622,7 +606,7 @@ pub mod stateful_order_event_v1 { #[prost(message, tag = "7")] LongTermOrderPlacement(LongTermOrderPlacementV1), #[prost(message, tag = "8")] - OrderReplace(LongTermOrderReplacementV1), + OrderReplacement(LongTermOrderReplacementV1), } } impl ::prost::Name for StatefulOrderEventV1 { @@ -637,7 +621,6 @@ impl ::prost::Name for StatefulOrderEventV1 { } /// AssetCreateEventV1 message contains all the information about an new Asset on /// the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AssetCreateEventV1 { /// Unique, sequentially-generated. @@ -677,7 +660,6 @@ impl ::prost::Name for AssetCreateEventV1 { /// new Perpetual Market on the dYdX chain. /// Deprecated. See PerpetualMarketCreateEventV2 for the most up to date message /// for the event to create a new Perpetual Market. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualMarketCreateEventV1 { /// Unique Perpetual id. @@ -739,7 +721,6 @@ impl ::prost::Name for PerpetualMarketCreateEventV1 { } /// PerpetualMarketCreateEventV2 message contains all the information about a /// new Perpetual Market on the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualMarketCreateEventV2 { /// Unique Perpetual id. @@ -804,7 +785,6 @@ impl ::prost::Name for PerpetualMarketCreateEventV2 { } /// LiquidityTierUpsertEventV1 message contains all the information to /// create/update a Liquidity Tier on the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LiquidityTierUpsertEventV1 { /// Unique id. @@ -842,8 +822,7 @@ impl ::prost::Name for LiquidityTierUpsertEventV1 { } /// UpdateClobPairEventV1 message contains all the information about an update to /// a clob pair on the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateClobPairEventV1 { /// Unique clob pair Id associated with this perpetual market /// Defined in clob.clob_pair @@ -881,7 +860,6 @@ impl ::prost::Name for UpdateClobPairEventV1 { } /// UpdatePerpetualEventV1 message contains all the information about an update /// to a perpetual on the dYdX chain. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdatePerpetualEventV1 { /// Unique Perpetual id. @@ -920,7 +898,6 @@ impl ::prost::Name for UpdatePerpetualEventV1 { } /// TradingRewardsEventV1 is communicates all trading rewards for all accounts /// that receive trade rewards in the block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TradingRewardsEventV1 { /// The list of all trading rewards in the block. @@ -939,7 +916,6 @@ impl ::prost::Name for TradingRewardsEventV1 { } /// AddressTradingReward contains info on an instance of an address receiving a /// reward -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressTradingReward { /// The address of the wallet that will receive the trading reward. @@ -961,10 +937,9 @@ impl ::prost::Name for AddressTradingReward { } } /// OpenInterestUpdateEventV1 is used for open interest update events -#[allow(clippy::derive_partial_eq_without_eq)] +/// Deprecated. #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpenInterestUpdateEventV1 { - /// The list of all open interest updates in the block. #[prost(message, repeated, tag = "1")] pub open_interest_updates: ::prost::alloc::vec::Vec, } @@ -979,10 +954,9 @@ impl ::prost::Name for OpenInterestUpdateEventV1 { } } /// OpenInterestUpdate contains a single open interest update for a perpetual -#[allow(clippy::derive_partial_eq_without_eq)] +/// Deprecated. #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpenInterestUpdate { - /// The ID of the perpetual market. #[prost(uint32, tag = "1")] pub perpetual_id: u32, /// The new open interest value for the perpetual market. @@ -1002,7 +976,6 @@ impl ::prost::Name for OpenInterestUpdate { /// LiquidationEventV2 message contains all the information needed to update /// the liquidity tiers. It contains all the fields from V1 along with the /// open interest caps. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LiquidityTierUpsertEventV2 { /// Unique id. @@ -1044,3 +1017,46 @@ impl ::prost::Name for LiquidityTierUpsertEventV2 { "/dydxprotocol.indexer.events.LiquidityTierUpsertEventV2".into() } } +/// Event emitted when a referee is registered with an affiliate. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterAffiliateEventV1 { + /// Address of the referee being registered. + #[prost(string, tag = "1")] + pub referee: ::prost::alloc::string::String, + /// Address of the affiliate associated with the referee. + #[prost(string, tag = "2")] + pub affiliate: ::prost::alloc::string::String, +} +impl ::prost::Name for RegisterAffiliateEventV1 { + const NAME: &'static str = "RegisterAffiliateEventV1"; + const PACKAGE: &'static str = "dydxprotocol.indexer.events"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.indexer.events.RegisterAffiliateEventV1".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.indexer.events.RegisterAffiliateEventV1".into() + } +} +/// Event emitted when a vault is created / updated. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpsertVaultEventV1 { + /// Address of the vault. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Clob pair Id associated with the vault. + #[prost(uint32, tag = "2")] + pub clob_pair_id: u32, + /// Status of the vault. + #[prost(enumeration = "super::protocol::v1::VaultStatus", tag = "3")] + pub status: i32, +} +impl ::prost::Name for UpsertVaultEventV1 { + const NAME: &'static str = "UpsertVaultEventV1"; + const PACKAGE: &'static str = "dydxprotocol.indexer.events"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.indexer.events.UpsertVaultEventV1".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.indexer.events.UpsertVaultEventV1".into() + } +} diff --git a/v4-proto-rs/src/dydxprotocol.indexer.indexer_manager.rs b/v4-proto-rs/src/dydxprotocol.indexer.indexer_manager.rs index 4403e6bb5e..74375b3bbe 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.indexer_manager.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.indexer_manager.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// IndexerTendermintEventWrapper is a wrapper around IndexerTendermintEvent, /// with an additional txn_hash field. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerTendermintEventWrapper { #[prost(message, optional, tag = "1")] @@ -21,7 +20,6 @@ impl ::prost::Name for IndexerTendermintEventWrapper { } /// IndexerEventsStoreValue represents the type of the value of the /// `IndexerEventsStore` in state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerEventsStoreValue { #[prost(message, repeated, tag = "1")] @@ -40,7 +38,6 @@ impl ::prost::Name for IndexerEventsStoreValue { /// IndexerTendermintEvent contains the base64 encoded event proto emitted from /// the dYdX application as well as additional metadata to determine the ordering /// of the event within the block and the subtype of the event. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerTendermintEvent { /// Subtype of the event e.g. "order_fill", "subaccount_update", etc. @@ -97,9 +94,9 @@ pub mod indexer_tendermint_event { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - BlockEvent::Unspecified => "BLOCK_EVENT_UNSPECIFIED", - BlockEvent::BeginBlock => "BLOCK_EVENT_BEGIN_BLOCK", - BlockEvent::EndBlock => "BLOCK_EVENT_END_BLOCK", + Self::Unspecified => "BLOCK_EVENT_UNSPECIFIED", + Self::BeginBlock => "BLOCK_EVENT_BEGIN_BLOCK", + Self::EndBlock => "BLOCK_EVENT_END_BLOCK", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -115,8 +112,7 @@ pub mod indexer_tendermint_event { /// ordering_within_block is either the transaction index or a boolean /// indicating the event was generated during processing the block rather than /// any specific transaction e.g. during FinalizeBlock. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum OrderingWithinBlock { #[prost(uint32, tag = "3")] TransactionIndex(u32), @@ -138,7 +134,6 @@ impl ::prost::Name for IndexerTendermintEvent { /// metadata for the block height, timestamp of the block and a list of all the /// hashes of the transactions within the block. The transaction hashes follow /// the ordering of the transactions as they appear within the block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerTendermintBlock { #[prost(uint32, tag = "1")] diff --git a/v4-proto-rs/src/dydxprotocol.indexer.off_chain_updates.rs b/v4-proto-rs/src/dydxprotocol.indexer.off_chain_updates.rs index 56dd4cda0a..6e83721315 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.off_chain_updates.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.off_chain_updates.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// OrderPlace messages contain the order placed/replaced. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderPlaceV1 { #[prost(message, optional, tag = "1")] @@ -53,11 +52,9 @@ pub mod order_place_v1 { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OrderPlacementStatus::Unspecified => "ORDER_PLACEMENT_STATUS_UNSPECIFIED", - OrderPlacementStatus::BestEffortOpened => { - "ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED" - } - OrderPlacementStatus::Opened => "ORDER_PLACEMENT_STATUS_OPENED", + Self::Unspecified => "ORDER_PLACEMENT_STATUS_UNSPECIFIED", + Self::BestEffortOpened => "ORDER_PLACEMENT_STATUS_BEST_EFFORT_OPENED", + Self::Opened => "ORDER_PLACEMENT_STATUS_OPENED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -85,7 +82,6 @@ impl ::prost::Name for OrderPlaceV1 { } /// OrderRemove messages contain the id of the order removed, the reason for the /// removal and the resulting status from the removal. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderRemoveV1 { #[prost(message, optional, tag = "1")] @@ -144,12 +140,10 @@ pub mod order_remove_v1 { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OrderRemovalStatus::Unspecified => "ORDER_REMOVAL_STATUS_UNSPECIFIED", - OrderRemovalStatus::BestEffortCanceled => { - "ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED" - } - OrderRemovalStatus::Canceled => "ORDER_REMOVAL_STATUS_CANCELED", - OrderRemovalStatus::Filled => "ORDER_REMOVAL_STATUS_FILLED", + Self::Unspecified => "ORDER_REMOVAL_STATUS_UNSPECIFIED", + Self::BestEffortCanceled => "ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED", + Self::Canceled => "ORDER_REMOVAL_STATUS_CANCELED", + Self::Filled => "ORDER_REMOVAL_STATUS_FILLED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -178,7 +172,6 @@ impl ::prost::Name for OrderRemoveV1 { } /// OrderUpdate messages contain the id of the order being updated, and the /// updated total filled quantums of the order. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderUpdateV1 { #[prost(message, optional, tag = "1")] @@ -196,15 +189,17 @@ impl ::prost::Name for OrderUpdateV1 { "/dydxprotocol.indexer.off_chain_updates.OrderUpdateV1".into() } } -/// OrderReplace messages contain the replacement order. -#[allow(clippy::derive_partial_eq_without_eq)] +/// OrderReplace messages contain the old order ID and the replacement order. #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderReplaceV1 { + /// vault replaces orders with a different order ID #[prost(message, optional, tag = "1")] + pub old_order_id: ::core::option::Option, + #[prost(message, optional, tag = "2")] pub order: ::core::option::Option, - #[prost(enumeration = "order_place_v1::OrderPlacementStatus", tag = "2")] + #[prost(enumeration = "order_place_v1::OrderPlacementStatus", tag = "3")] pub placement_status: i32, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "4")] pub time_stamp: ::core::option::Option<::prost_types::Timestamp>, } impl ::prost::Name for OrderReplaceV1 { @@ -219,7 +214,6 @@ impl ::prost::Name for OrderReplaceV1 { } /// An OffChainUpdate message is the message type which will be sent on Kafka to /// the Indexer. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OffChainUpdateV1 { /// Contains one of an OrderPlaceV1, OrderRemoveV1, OrderUpdateV1, and @@ -231,7 +225,6 @@ pub struct OffChainUpdateV1 { pub mod off_chain_update_v1 { /// Contains one of an OrderPlaceV1, OrderRemoveV1, OrderUpdateV1, and /// OrderReplaceV1 message. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum UpdateMessage { #[prost(message, tag = "1")] diff --git a/v4-proto-rs/src/dydxprotocol.indexer.protocol.v1.rs b/v4-proto-rs/src/dydxprotocol.indexer.protocol.v1.rs index b25016f4af..2744eaab2f 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.protocol.v1.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.protocol.v1.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// IndexerSubaccountId defines a unique identifier for a Subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerSubaccountId { /// The address of the wallet that owns this subaccount. @@ -23,7 +22,6 @@ impl ::prost::Name for IndexerSubaccountId { } /// IndexerPerpetualPosition are an account’s positions of a `Perpetual`. /// Therefore they hold any information needed to trade perpetuals. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerPerpetualPosition { /// The `Id` of the `Perpetual`. @@ -55,7 +53,6 @@ impl ::prost::Name for IndexerPerpetualPosition { } /// IndexerAssetPosition define an account’s positions of an `Asset`. /// Therefore they hold any information needed to trade on Spot and Margin. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerAssetPosition { /// The `Id` of the `Asset`. @@ -81,7 +78,6 @@ impl ::prost::Name for IndexerAssetPosition { } } /// IndexerOrderId refers to a single order belonging to a Subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerOrderId { /// The subaccount ID that opened this order. @@ -127,7 +123,6 @@ impl ::prost::Name for IndexerOrderId { } /// IndexerOrderV1 represents a single order belonging to a `Subaccount` /// for a particular `ClobPair`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexerOrder { /// The unique ID of this order. Meant to be unique across all orders. @@ -205,9 +200,9 @@ pub mod indexer_order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Side::Unspecified => "SIDE_UNSPECIFIED", - Side::Buy => "SIDE_BUY", - Side::Sell => "SIDE_SELL", + Self::Unspecified => "SIDE_UNSPECIFIED", + Self::Buy => "SIDE_BUY", + Self::Sell => "SIDE_SELL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -261,10 +256,10 @@ pub mod indexer_order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - TimeInForce::Unspecified => "TIME_IN_FORCE_UNSPECIFIED", - TimeInForce::Ioc => "TIME_IN_FORCE_IOC", - TimeInForce::PostOnly => "TIME_IN_FORCE_POST_ONLY", - TimeInForce::FillOrKill => "TIME_IN_FORCE_FILL_OR_KILL", + Self::Unspecified => "TIME_IN_FORCE_UNSPECIFIED", + Self::Ioc => "TIME_IN_FORCE_IOC", + Self::PostOnly => "TIME_IN_FORCE_POST_ONLY", + Self::FillOrKill => "TIME_IN_FORCE_FILL_OR_KILL", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -310,9 +305,9 @@ pub mod indexer_order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConditionType::Unspecified => "CONDITION_TYPE_UNSPECIFIED", - ConditionType::StopLoss => "CONDITION_TYPE_STOP_LOSS", - ConditionType::TakeProfit => "CONDITION_TYPE_TAKE_PROFIT", + Self::Unspecified => "CONDITION_TYPE_UNSPECIFIED", + Self::StopLoss => "CONDITION_TYPE_STOP_LOSS", + Self::TakeProfit => "CONDITION_TYPE_TAKE_PROFIT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -326,8 +321,7 @@ pub mod indexer_order { } } /// Information about when the order expires. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum GoodTilOneof { /// The last block this order can be executed at (after which it will be /// unfillable). Used only for Short-Term orders. If this value is non-zero @@ -391,13 +385,13 @@ impl ClobPairStatus { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ClobPairStatus::Unspecified => "CLOB_PAIR_STATUS_UNSPECIFIED", - ClobPairStatus::Active => "CLOB_PAIR_STATUS_ACTIVE", - ClobPairStatus::Paused => "CLOB_PAIR_STATUS_PAUSED", - ClobPairStatus::CancelOnly => "CLOB_PAIR_STATUS_CANCEL_ONLY", - ClobPairStatus::PostOnly => "CLOB_PAIR_STATUS_POST_ONLY", - ClobPairStatus::Initializing => "CLOB_PAIR_STATUS_INITIALIZING", - ClobPairStatus::FinalSettlement => "CLOB_PAIR_STATUS_FINAL_SETTLEMENT", + Self::Unspecified => "CLOB_PAIR_STATUS_UNSPECIFIED", + Self::Active => "CLOB_PAIR_STATUS_ACTIVE", + Self::Paused => "CLOB_PAIR_STATUS_PAUSED", + Self::CancelOnly => "CLOB_PAIR_STATUS_CANCEL_ONLY", + Self::PostOnly => "CLOB_PAIR_STATUS_POST_ONLY", + Self::Initializing => "CLOB_PAIR_STATUS_INITIALIZING", + Self::FinalSettlement => "CLOB_PAIR_STATUS_FINAL_SETTLEMENT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -433,9 +427,9 @@ impl PerpetualMarketType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PerpetualMarketType::Unspecified => "PERPETUAL_MARKET_TYPE_UNSPECIFIED", - PerpetualMarketType::Cross => "PERPETUAL_MARKET_TYPE_CROSS", - PerpetualMarketType::Isolated => "PERPETUAL_MARKET_TYPE_ISOLATED", + Self::Unspecified => "PERPETUAL_MARKET_TYPE_UNSPECIFIED", + Self::Cross => "PERPETUAL_MARKET_TYPE_CROSS", + Self::Isolated => "PERPETUAL_MARKET_TYPE_ISOLATED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -448,3 +442,44 @@ impl PerpetualMarketType { } } } +/// VaultStatus represents the status of a vault. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VaultStatus { + /// Default value, invalid and unused. + Unspecified = 0, + /// Don’t place orders. Does not count toward global vault balances. + Deactivated = 1, + /// Don’t place orders. Does count towards global vault balances. + StandBy = 2, + /// Places orders on both sides of the book. + Quoting = 3, + /// Only place orders that close the position. + CloseOnly = 4, +} +impl VaultStatus { + /// 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 { + Self::Unspecified => "VAULT_STATUS_UNSPECIFIED", + Self::Deactivated => "VAULT_STATUS_DEACTIVATED", + Self::StandBy => "VAULT_STATUS_STAND_BY", + Self::Quoting => "VAULT_STATUS_QUOTING", + Self::CloseOnly => "VAULT_STATUS_CLOSE_ONLY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VAULT_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "VAULT_STATUS_DEACTIVATED" => Some(Self::Deactivated), + "VAULT_STATUS_STAND_BY" => Some(Self::StandBy), + "VAULT_STATUS_QUOTING" => Some(Self::Quoting), + "VAULT_STATUS_CLOSE_ONLY" => Some(Self::CloseOnly), + _ => None, + } + } +} diff --git a/v4-proto-rs/src/dydxprotocol.indexer.redis.rs b/v4-proto-rs/src/dydxprotocol.indexer.redis.rs index bdb1bdccc3..934c9ab15d 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.redis.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.redis.rs @@ -2,7 +2,6 @@ /// RedisOrder is a proto for orders stored in Redis. This proto holds some /// human-readable values such as price, size and ticker as well as the original /// `Order` proto from the dYdX application. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedisOrder { /// uuid of the Order generated by the Indexer based on the `OrderId`. @@ -55,9 +54,9 @@ pub mod redis_order { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - TickerType::Unspecified => "TICKER_TYPE_UNSPECIFIED", - TickerType::Perpetual => "TICKER_TYPE_PERPETUAL", - TickerType::Spot => "TICKER_TYPE_SPOT", + Self::Unspecified => "TICKER_TYPE_UNSPECIFIED", + Self::Perpetual => "TICKER_TYPE_PERPETUAL", + Self::Spot => "TICKER_TYPE_SPOT", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/v4-proto-rs/src/dydxprotocol.indexer.shared.rs b/v4-proto-rs/src/dydxprotocol.indexer.shared.rs index 570398f54b..69dd782553 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.shared.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.shared.rs @@ -60,34 +60,28 @@ impl OrderRemovalReason { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OrderRemovalReason::Unspecified => "ORDER_REMOVAL_REASON_UNSPECIFIED", - OrderRemovalReason::Expired => "ORDER_REMOVAL_REASON_EXPIRED", - OrderRemovalReason::UserCanceled => "ORDER_REMOVAL_REASON_USER_CANCELED", - OrderRemovalReason::Undercollateralized => { - "ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED" - } - OrderRemovalReason::InternalError => "ORDER_REMOVAL_REASON_INTERNAL_ERROR", - OrderRemovalReason::SelfTradeError => "ORDER_REMOVAL_REASON_SELF_TRADE_ERROR", - OrderRemovalReason::PostOnlyWouldCrossMakerOrder => { + Self::Unspecified => "ORDER_REMOVAL_REASON_UNSPECIFIED", + Self::Expired => "ORDER_REMOVAL_REASON_EXPIRED", + Self::UserCanceled => "ORDER_REMOVAL_REASON_USER_CANCELED", + Self::Undercollateralized => "ORDER_REMOVAL_REASON_UNDERCOLLATERALIZED", + Self::InternalError => "ORDER_REMOVAL_REASON_INTERNAL_ERROR", + Self::SelfTradeError => "ORDER_REMOVAL_REASON_SELF_TRADE_ERROR", + Self::PostOnlyWouldCrossMakerOrder => { "ORDER_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER" } - OrderRemovalReason::ImmediateOrCancelWouldRestOnBook => { + Self::ImmediateOrCancelWouldRestOnBook => { "ORDER_REMOVAL_REASON_IMMEDIATE_OR_CANCEL_WOULD_REST_ON_BOOK" } - OrderRemovalReason::FokOrderCouldNotBeFullyFulled => { + Self::FokOrderCouldNotBeFullyFulled => { "ORDER_REMOVAL_REASON_FOK_ORDER_COULD_NOT_BE_FULLY_FULLED" } - OrderRemovalReason::ReduceOnlyResize => { - "ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE" - } - OrderRemovalReason::IndexerExpired => "ORDER_REMOVAL_REASON_INDEXER_EXPIRED", - OrderRemovalReason::Replaced => "ORDER_REMOVAL_REASON_REPLACED", - OrderRemovalReason::FullyFilled => "ORDER_REMOVAL_REASON_FULLY_FILLED", - OrderRemovalReason::EquityTier => "ORDER_REMOVAL_REASON_EQUITY_TIER", - OrderRemovalReason::FinalSettlement => { - "ORDER_REMOVAL_REASON_FINAL_SETTLEMENT" - } - OrderRemovalReason::ViolatesIsolatedSubaccountConstraints => { + Self::ReduceOnlyResize => "ORDER_REMOVAL_REASON_REDUCE_ONLY_RESIZE", + Self::IndexerExpired => "ORDER_REMOVAL_REASON_INDEXER_EXPIRED", + Self::Replaced => "ORDER_REMOVAL_REASON_REPLACED", + Self::FullyFilled => "ORDER_REMOVAL_REASON_FULLY_FILLED", + Self::EquityTier => "ORDER_REMOVAL_REASON_EQUITY_TIER", + Self::FinalSettlement => "ORDER_REMOVAL_REASON_FINAL_SETTLEMENT", + Self::ViolatesIsolatedSubaccountConstraints => { "ORDER_REMOVAL_REASON_VIOLATES_ISOLATED_SUBACCOUNT_CONSTRAINTS" } } diff --git a/v4-proto-rs/src/dydxprotocol.indexer.socks.rs b/v4-proto-rs/src/dydxprotocol.indexer.socks.rs index b664937294..09999d1bef 100644 --- a/v4-proto-rs/src/dydxprotocol.indexer.socks.rs +++ b/v4-proto-rs/src/dydxprotocol.indexer.socks.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Message to be sent through the 'to-websockets-orderbooks` kafka topic. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderbookMessage { /// Stringified JSON object of all events to be streamed. @@ -24,7 +23,6 @@ impl ::prost::Name for OrderbookMessage { } } /// Message to be sent through the 'to-websockets-subaccounts` kafka topic. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubaccountMessage { /// Block height where the contents occur. @@ -57,7 +55,6 @@ impl ::prost::Name for SubaccountMessage { } } /// Message to be sent through the 'to-websockets-trades` kafka topic. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TradeMessage { /// Block height where the contents occur. @@ -84,7 +81,6 @@ impl ::prost::Name for TradeMessage { } } /// Message to be sent through the 'to-websockets-markets` kafka topic. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketMessage { /// Stringified JSON object of all events to be streamed. @@ -105,7 +101,6 @@ impl ::prost::Name for MarketMessage { } } /// Message to be sent through the 'to-websockets-candles` kafka topic. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CandleMessage { /// Stringified JSON object of all events to be streamed. @@ -160,13 +155,13 @@ pub mod candle_message { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Resolution::OneMinute => "ONE_MINUTE", - Resolution::FiveMinutes => "FIVE_MINUTES", - Resolution::FifteenMinutes => "FIFTEEN_MINUTES", - Resolution::ThirtyMinutes => "THIRTY_MINUTES", - Resolution::OneHour => "ONE_HOUR", - Resolution::FourHours => "FOUR_HOURS", - Resolution::OneDay => "ONE_DAY", + Self::OneMinute => "ONE_MINUTE", + Self::FiveMinutes => "FIVE_MINUTES", + Self::FifteenMinutes => "FIFTEEN_MINUTES", + Self::ThirtyMinutes => "THIRTY_MINUTES", + Self::OneHour => "ONE_HOUR", + Self::FourHours => "FOUR_HOURS", + Self::OneDay => "ONE_DAY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -194,3 +189,26 @@ impl ::prost::Name for CandleMessage { "/dydxprotocol.indexer.socks.CandleMessage".into() } } +/// Message to be sent through the 'to-websockets-block-height` kafka topic. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockHeightMessage { + /// Block height where the contents occur. + #[prost(string, tag = "1")] + pub block_height: ::prost::alloc::string::String, + /// ISO formatted time of the block height. + #[prost(string, tag = "2")] + pub time: ::prost::alloc::string::String, + /// Version of the websocket message. + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, +} +impl ::prost::Name for BlockHeightMessage { + const NAME: &'static str = "BlockHeightMessage"; + const PACKAGE: &'static str = "dydxprotocol.indexer.socks"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.indexer.socks.BlockHeightMessage".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.indexer.socks.BlockHeightMessage".into() + } +} diff --git a/v4-proto-rs/src/dydxprotocol.listing.rs b/v4-proto-rs/src/dydxprotocol.listing.rs new file mode 100644 index 0000000000..c1f3b7747e --- /dev/null +++ b/v4-proto-rs/src/dydxprotocol.listing.rs @@ -0,0 +1,538 @@ +// This file is @generated by prost-build. +/// ListingVaultDepositParams represents the params for PML megavault deposits +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListingVaultDepositParams { + /// Amount that will be deposited into the new market vault exclusively + #[prost(bytes = "vec", tag = "1")] + pub new_vault_deposit_amount: ::prost::alloc::vec::Vec, + /// Amount deposited into the main vault exclusively. This amount does not + /// include the amount deposited into the new vault. + #[prost(bytes = "vec", tag = "2")] + pub main_vault_deposit_amount: ::prost::alloc::vec::Vec, + /// Lockup period for this deposit + #[prost(uint32, tag = "3")] + pub num_blocks_to_lock_shares: u32, +} +impl ::prost::Name for ListingVaultDepositParams { + const NAME: &'static str = "ListingVaultDepositParams"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.ListingVaultDepositParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.ListingVaultDepositParams".into() + } +} +/// GenesisState defines `x/listing`'s genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// hard_cap_for_markets is the hard cap for the number of markets that can be + /// listed + #[prost(uint32, tag = "1")] + pub hard_cap_for_markets: u32, + /// listing_vault_deposit_params is the params for PML megavault deposits + #[prost(message, optional, tag = "2")] + pub listing_vault_deposit_params: ::core::option::Option, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.GenesisState".into() + } +} +/// Queries for the hard cap on listed markets +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMarketsHardCap {} +impl ::prost::Name for QueryMarketsHardCap { + const NAME: &'static str = "QueryMarketsHardCap"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.QueryMarketsHardCap".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.QueryMarketsHardCap".into() + } +} +/// Response type indicating the hard cap on listed markets +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMarketsHardCapResponse { + #[prost(uint32, tag = "1")] + pub hard_cap: u32, +} +impl ::prost::Name for QueryMarketsHardCapResponse { + const NAME: &'static str = "QueryMarketsHardCapResponse"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.QueryMarketsHardCapResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.QueryMarketsHardCapResponse".into() + } +} +/// Queries the listing vault deposit params +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryListingVaultDepositParams {} +impl ::prost::Name for QueryListingVaultDepositParams { + const NAME: &'static str = "QueryListingVaultDepositParams"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.QueryListingVaultDepositParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.QueryListingVaultDepositParams".into() + } +} +/// Response type for QueryListingVaultDepositParams +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryListingVaultDepositParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryListingVaultDepositParamsResponse { + const NAME: &'static str = "QueryListingVaultDepositParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.QueryListingVaultDepositParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.QueryListingVaultDepositParamsResponse".into() + } +} +/// Generated client implementations. +pub mod query_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query defines the gRPC querier service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// Queries for the hard cap number of listed markets + pub async fn markets_hard_cap( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.listing.Query/MarketsHardCap", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.listing.Query", "MarketsHardCap")); + self.inner.unary(req, path, codec).await + } + /// Queries the listing vault deposit params + pub async fn listing_vault_deposit_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.listing.Query/ListingVaultDepositParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.listing.Query", + "ListingVaultDepositParams", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// MsgSetMarketsHardCap is used to set a hard cap on the number of markets +/// listed +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetMarketsHardCap { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Hard cap for the total number of markets listed + #[prost(uint32, tag = "2")] + pub hard_cap_for_markets: u32, +} +impl ::prost::Name for MsgSetMarketsHardCap { + const NAME: &'static str = "MsgSetMarketsHardCap"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgSetMarketsHardCap".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgSetMarketsHardCap".into() + } +} +/// MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetMarketsHardCapResponse {} +impl ::prost::Name for MsgSetMarketsHardCapResponse { + const NAME: &'static str = "MsgSetMarketsHardCapResponse"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgSetMarketsHardCapResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgSetMarketsHardCapResponse".into() + } +} +/// MsgCreateMarketPermissionless is a message used to create new markets without +/// going through x/gov +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateMarketPermissionless { + /// The name of the `Perpetual` (e.g. `BTC-USD`). + #[prost(string, tag = "1")] + pub ticker: ::prost::alloc::string::String, + /// The subaccount to deposit from. + #[prost(message, optional, tag = "2")] + pub subaccount_id: ::core::option::Option, +} +impl ::prost::Name for MsgCreateMarketPermissionless { + const NAME: &'static str = "MsgCreateMarketPermissionless"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgCreateMarketPermissionless".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgCreateMarketPermissionless".into() + } +} +/// MsgCreateMarketPermissionlessResponse defines the +/// MsgCreateMarketPermissionless response +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgCreateMarketPermissionlessResponse {} +impl ::prost::Name for MsgCreateMarketPermissionlessResponse { + const NAME: &'static str = "MsgCreateMarketPermissionlessResponse"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgCreateMarketPermissionlessResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgCreateMarketPermissionlessResponse".into() + } +} +/// MsgSetListingVaultDepositParams is a message used to set PML megavault +/// deposit params +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetListingVaultDepositParams { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Params which define the vault deposit for market listing + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgSetListingVaultDepositParams { + const NAME: &'static str = "MsgSetListingVaultDepositParams"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgSetListingVaultDepositParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgSetListingVaultDepositParams".into() + } +} +/// MsgSetListingVaultDepositParamsResponse defines the +/// MsgSetListingVaultDepositParams response +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetListingVaultDepositParamsResponse {} +impl ::prost::Name for MsgSetListingVaultDepositParamsResponse { + const NAME: &'static str = "MsgSetListingVaultDepositParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.listing"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse".into() + } +} +/// Generated client implementations. +pub mod msg_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Msg defines the Msg service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// SetMarketsHardCap sets a hard cap on the number of markets listed + pub async fn set_markets_hard_cap( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.listing.Msg/SetMarketsHardCap", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.listing.Msg", "SetMarketsHardCap"), + ); + self.inner.unary(req, path, codec).await + } + /// CreateMarketPermissionless creates a new market without going through x/gov + pub async fn create_market_permissionless( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.listing.Msg/CreateMarketPermissionless", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.listing.Msg", + "CreateMarketPermissionless", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SetListingVaultDepositParams sets PML megavault deposit params + pub async fn set_listing_vault_deposit_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.listing.Msg/SetListingVaultDepositParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.listing.Msg", + "SetListingVaultDepositParams", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/v4-proto-rs/src/dydxprotocol.perpetuals.rs b/v4-proto-rs/src/dydxprotocol.perpetuals.rs index 7fd52a2abb..9f683f6193 100644 --- a/v4-proto-rs/src/dydxprotocol.perpetuals.rs +++ b/v4-proto-rs/src/dydxprotocol.perpetuals.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Perpetual represents a perpetual on the dYdX exchange. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Perpetual { /// PerpetualParams is the parameters of the perpetual. @@ -26,7 +25,6 @@ impl ::prost::Name for Perpetual { } /// PerpetualParams represents the parameters of a perpetual on the dYdX /// exchange. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualParams { /// Unique, sequentially-generated. @@ -68,7 +66,6 @@ impl ::prost::Name for PerpetualParams { } } /// MarketPremiums stores a list of premiums for a single perpetual market. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketPremiums { /// perpetual_id is the Id of the perpetual market. @@ -96,7 +93,6 @@ impl ::prost::Name for MarketPremiums { /// values for that market. /// This struct can either be used to store `PremiumVotes` or /// `PremiumSamples`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PremiumStore { /// all_market_premiums a list of `MarketPremiums`, each corresponding to @@ -123,7 +119,6 @@ impl ::prost::Name for PremiumStore { } } /// LiquidityTier stores margin information. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LiquidityTier { /// Unique id. @@ -194,9 +189,9 @@ impl PerpetualMarketType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PerpetualMarketType::Unspecified => "PERPETUAL_MARKET_TYPE_UNSPECIFIED", - PerpetualMarketType::Cross => "PERPETUAL_MARKET_TYPE_CROSS", - PerpetualMarketType::Isolated => "PERPETUAL_MARKET_TYPE_ISOLATED", + Self::Unspecified => "PERPETUAL_MARKET_TYPE_UNSPECIFIED", + Self::Cross => "PERPETUAL_MARKET_TYPE_CROSS", + Self::Isolated => "PERPETUAL_MARKET_TYPE_ISOLATED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -210,8 +205,7 @@ impl PerpetualMarketType { } } /// Params defines the parameters for x/perpetuals module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// Funding rate clamp factor in parts-per-million, used for clamping 8-hour /// funding rates according to equation: |R| <= funding_rate_clamp_factor * @@ -239,7 +233,6 @@ impl ::prost::Name for Params { } } /// GenesisState defines the perpetuals module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] @@ -260,8 +253,7 @@ impl ::prost::Name for GenesisState { } } /// Queries a Perpetual by id. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPerpetualRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -277,7 +269,6 @@ impl ::prost::Name for QueryPerpetualRequest { } } /// QueryPerpetualResponse is response type for the Perpetual RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPerpetualResponse { #[prost(message, optional, tag = "1")] @@ -294,7 +285,6 @@ impl ::prost::Name for QueryPerpetualResponse { } } /// Queries a list of Perpetual items. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPerpetualsRequest { #[prost(message, optional, tag = "1")] @@ -313,7 +303,6 @@ impl ::prost::Name for QueryAllPerpetualsRequest { } } /// QueryAllPerpetualsResponse is response type for the AllPerpetuals RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPerpetualsResponse { #[prost(message, repeated, tag = "1")] @@ -334,7 +323,6 @@ impl ::prost::Name for QueryAllPerpetualsResponse { } } /// Queries a list of LiquidityTier items. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllLiquidityTiersRequest { #[prost(message, optional, tag = "1")] @@ -354,7 +342,6 @@ impl ::prost::Name for QueryAllLiquidityTiersRequest { } /// QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllLiquidityTiersResponse { #[prost(message, repeated, tag = "1")] @@ -375,8 +362,7 @@ impl ::prost::Name for QueryAllLiquidityTiersResponse { } } /// QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPremiumVotesRequest {} impl ::prost::Name for QueryPremiumVotesRequest { const NAME: &'static str = "QueryPremiumVotesRequest"; @@ -390,7 +376,6 @@ impl ::prost::Name for QueryPremiumVotesRequest { } /// QueryPremiumVotesResponse is the response type for the PremiumVotes RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPremiumVotesResponse { #[prost(message, optional, tag = "1")] @@ -408,8 +393,7 @@ impl ::prost::Name for QueryPremiumVotesResponse { } /// QueryPremiumSamplesRequest is the request type for the PremiumSamples RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryPremiumSamplesRequest {} impl ::prost::Name for QueryPremiumSamplesRequest { const NAME: &'static str = "QueryPremiumSamplesRequest"; @@ -423,7 +407,6 @@ impl ::prost::Name for QueryPremiumSamplesRequest { } /// QueryPremiumSamplesResponse is the response type for the PremiumSamples RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPremiumSamplesResponse { #[prost(message, optional, tag = "1")] @@ -440,8 +423,7 @@ impl ::prost::Name for QueryPremiumSamplesResponse { } } /// QueryParamsResponse is the response type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; @@ -454,8 +436,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, @@ -472,7 +453,13 @@ impl ::prost::Name for QueryParamsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -480,6 +467,7 @@ pub mod query_client { 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 @@ -495,8 +483,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -521,7 +509,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -568,8 +556,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -594,8 +581,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -622,8 +608,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -650,8 +635,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -678,8 +662,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -706,8 +689,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -723,7 +705,6 @@ pub mod query_client { } } /// MsgCreatePerpetual is a message used by x/gov to create a new perpetual. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePerpetual { /// The address that controls the module. @@ -745,8 +726,7 @@ impl ::prost::Name for MsgCreatePerpetual { } /// MsgCreatePerpetualResponse defines the CreatePerpetual /// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCreatePerpetualResponse {} impl ::prost::Name for MsgCreatePerpetualResponse { const NAME: &'static str = "MsgCreatePerpetualResponse"; @@ -760,7 +740,6 @@ impl ::prost::Name for MsgCreatePerpetualResponse { } /// MsgSetLiquidityTier is a message used by x/gov to create or update a /// liquidity tier. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetLiquidityTier { /// The address that controls the module. @@ -781,8 +760,7 @@ impl ::prost::Name for MsgSetLiquidityTier { } } /// MsgSetLiquidityTierResponse defines the SetLiquidityTier response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSetLiquidityTierResponse {} impl ::prost::Name for MsgSetLiquidityTierResponse { const NAME: &'static str = "MsgSetLiquidityTierResponse"; @@ -796,7 +774,6 @@ impl ::prost::Name for MsgSetLiquidityTierResponse { } /// MsgUpdatePerpetualParams is a message used by x/gov to update the parameters /// of a perpetual. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdatePerpetualParams { #[prost(string, tag = "1")] @@ -817,8 +794,7 @@ impl ::prost::Name for MsgUpdatePerpetualParams { } /// MsgUpdatePerpetualParamsResponse defines the UpdatePerpetualParams /// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdatePerpetualParamsResponse {} impl ::prost::Name for MsgUpdatePerpetualParamsResponse { const NAME: &'static str = "MsgUpdatePerpetualParamsResponse"; @@ -832,8 +808,7 @@ impl ::prost::Name for MsgUpdatePerpetualParamsResponse { } /// FundingPremium represents a funding premium value for a perpetual /// market. Can be used to represent a premium vote or a premium sample. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FundingPremium { /// The id of the perpetual market. #[prost(uint32, tag = "1")] @@ -853,7 +828,6 @@ impl ::prost::Name for FundingPremium { } } /// MsgAddPremiumVotes is a request type for the AddPremiumVotes method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAddPremiumVotes { #[prost(message, repeated, tag = "1")] @@ -871,8 +845,7 @@ impl ::prost::Name for MsgAddPremiumVotes { } /// MsgAddPremiumVotesResponse defines the AddPremiumVotes /// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAddPremiumVotesResponse {} impl ::prost::Name for MsgAddPremiumVotesResponse { const NAME: &'static str = "MsgAddPremiumVotesResponse"; @@ -886,7 +859,6 @@ impl ::prost::Name for MsgAddPremiumVotesResponse { } /// MsgUpdateParams is a message used by x/gov to update the parameters of the /// perpetuals module. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { #[prost(string, tag = "1")] @@ -906,8 +878,7 @@ impl ::prost::Name for MsgUpdateParams { } } /// MsgUpdateParamsResponse defines the UpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} impl ::prost::Name for MsgUpdateParamsResponse { const NAME: &'static str = "MsgUpdateParamsResponse"; @@ -921,7 +892,13 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -929,6 +906,7 @@ pub mod msg_client { 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 @@ -944,8 +922,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -970,7 +948,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -1018,8 +996,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1046,8 +1023,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1075,8 +1051,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1103,8 +1078,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -1134,8 +1108,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.prices.rs b/v4-proto-rs/src/dydxprotocol.prices.rs index a62d3cf018..f0ce9775d2 100644 --- a/v4-proto-rs/src/dydxprotocol.prices.rs +++ b/v4-proto-rs/src/dydxprotocol.prices.rs @@ -3,7 +3,6 @@ /// representing price values, resolving markets on individual exchanges, and /// generating price updates. This configuration is specific to the quote /// currency. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketParam { /// Unique, sequentially-generated value. @@ -16,10 +15,15 @@ pub struct MarketParam { /// For example if `Exponent == -5` then a `Value` of `1,000,000,000` /// represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest /// price step (in dollars) that can be recorded. + /// + /// Deprecated since v8.x. This value is now determined from the marketmap. + #[deprecated] #[prost(sint32, tag = "3")] pub exponent: i32, /// The minimum number of exchanges that should be reporting a live price for /// a price update to be considered valid. + /// + /// Deprecated since v8.x. This value is now determined from the marketmap. #[prost(uint32, tag = "4")] pub min_exchanges: u32, /// The minimum allowable change in `price` value that would cause a price @@ -28,6 +32,8 @@ pub struct MarketParam { pub min_price_change_ppm: u32, /// A string of json that encodes the configuration for resolving the price /// of this market on various exchanges. + /// + /// Deprecated since v8.x. This is now determined from the marketmap. #[prost(string, tag = "6")] pub exchange_config_json: ::prost::alloc::string::String, } @@ -42,14 +48,16 @@ impl ::prost::Name for MarketParam { } } /// MarketPrice is used by the application to store/retrieve oracle price. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MarketPrice { /// Unique, sequentially-generated value that matches `MarketParam`. #[prost(uint32, tag = "1")] pub id: u32, /// Static value. The exponent of the price. See the comment on the duplicate /// MarketParam field for more information. + /// + /// As of v7.1.x, this value is determined from the marketmap instead of + /// needing to match the MarketParam field. #[prost(sint32, tag = "2")] pub exponent: i32, /// The variable value that is updated by oracle price updates. `0` if it has @@ -68,7 +76,6 @@ impl ::prost::Name for MarketPrice { } } /// GenesisState defines the prices module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] @@ -88,8 +95,7 @@ impl ::prost::Name for GenesisState { } /// QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryMarketPriceRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -106,8 +112,7 @@ impl ::prost::Name for QueryMarketPriceRequest { } /// QueryMarketPriceResponse is response type for the Query/Params `MarketPrice` /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryMarketPriceResponse { #[prost(message, optional, tag = "1")] pub market_price: ::core::option::Option, @@ -124,7 +129,6 @@ impl ::prost::Name for QueryMarketPriceResponse { } /// QueryAllMarketPricesRequest is request type for the Query/Params /// `AllMarketPrices` RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllMarketPricesRequest { #[prost(message, optional, tag = "1")] @@ -144,7 +148,6 @@ impl ::prost::Name for QueryAllMarketPricesRequest { } /// QueryAllMarketPricesResponse is response type for the Query/Params /// `AllMarketPrices` RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllMarketPricesResponse { #[prost(message, repeated, tag = "1")] @@ -166,8 +169,7 @@ impl ::prost::Name for QueryAllMarketPricesResponse { } /// QueryMarketParamsRequest is request type for the Query/Params `MarketParams` /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryMarketParamRequest { #[prost(uint32, tag = "1")] pub id: u32, @@ -184,7 +186,6 @@ impl ::prost::Name for QueryMarketParamRequest { } /// QueryMarketParamResponse is response type for the Query/Params `MarketParams` /// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryMarketParamResponse { #[prost(message, optional, tag = "1")] @@ -202,7 +203,6 @@ impl ::prost::Name for QueryMarketParamResponse { } /// QueryAllMarketParamsRequest is request type for the Query/Params /// `AllMarketParams` RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllMarketParamsRequest { #[prost(message, optional, tag = "1")] @@ -222,7 +222,6 @@ impl ::prost::Name for QueryAllMarketParamsRequest { } /// QueryAllMarketParamsResponse is response type for the Query/Params /// `AllMarketParams` RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllMarketParamsResponse { #[prost(message, repeated, tag = "1")] @@ -244,7 +243,13 @@ impl ::prost::Name for QueryAllMarketParamsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -252,6 +257,7 @@ pub mod query_client { 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 @@ -267,8 +273,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -293,7 +299,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -340,8 +346,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -366,8 +371,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -392,8 +396,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -418,8 +421,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -436,7 +438,6 @@ pub mod query_client { } /// MsgCreateOracleMarket is a message used by x/gov for creating a new oracle /// market. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateOracleMarket { /// The address that controls the module. @@ -457,8 +458,7 @@ impl ::prost::Name for MsgCreateOracleMarket { } } /// MsgCreateOracleMarketResponse defines the CreateOracleMarket response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCreateOracleMarketResponse {} impl ::prost::Name for MsgCreateOracleMarketResponse { const NAME: &'static str = "MsgCreateOracleMarketResponse"; @@ -471,7 +471,6 @@ impl ::prost::Name for MsgCreateOracleMarketResponse { } } /// MsgUpdateMarketPrices is a request type for the UpdateMarketPrices method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateMarketPrices { #[prost(message, repeated, tag = "1")] @@ -482,8 +481,7 @@ pub struct MsgUpdateMarketPrices { /// Nested message and enum types in `MsgUpdateMarketPrices`. pub mod msg_update_market_prices { /// MarketPrice represents a price update for a single market - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MarketPrice { /// The id of market to update #[prost(uint32, tag = "1")] @@ -515,8 +513,7 @@ impl ::prost::Name for MsgUpdateMarketPrices { } /// MsgUpdateMarketPricesResponse defines the MsgUpdateMarketPrices response /// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateMarketPricesResponse {} impl ::prost::Name for MsgUpdateMarketPricesResponse { const NAME: &'static str = "MsgUpdateMarketPricesResponse"; @@ -530,7 +527,6 @@ impl ::prost::Name for MsgUpdateMarketPricesResponse { } /// MsgUpdateMarketParam is a message used by x/gov for updating the parameters /// of an oracle market. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateMarketParam { #[prost(string, tag = "1")] @@ -550,8 +546,7 @@ impl ::prost::Name for MsgUpdateMarketParam { } } /// MsgUpdateMarketParamResponse defines the UpdateMarketParam response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateMarketParamResponse {} impl ::prost::Name for MsgUpdateMarketParamResponse { const NAME: &'static str = "MsgUpdateMarketParamResponse"; @@ -565,7 +560,13 @@ impl ::prost::Name for MsgUpdateMarketParamResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -573,6 +574,7 @@ pub mod msg_client { 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 @@ -588,8 +590,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -614,7 +616,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -662,8 +664,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -690,8 +691,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -719,8 +719,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.ratelimit.rs b/v4-proto-rs/src/dydxprotocol.ratelimit.rs index d243ba3c70..a927d43ad3 100644 --- a/v4-proto-rs/src/dydxprotocol.ratelimit.rs +++ b/v4-proto-rs/src/dydxprotocol.ratelimit.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// LimitParams defines rate limit params on a denom. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LimitParams { /// denom is the denomination of the token being rate limited. @@ -23,7 +22,6 @@ impl ::prost::Name for LimitParams { } } /// Limiter defines one rate-limiter on a specfic denom. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Limiter { /// period is the rolling time period for which the limit applies @@ -52,7 +50,6 @@ impl ::prost::Name for Limiter { } } /// DenomCapacity stores a list of rate limit capacity for a denom. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomCapacity { /// denom is the denomination of the token being rate limited. @@ -76,7 +73,6 @@ impl ::prost::Name for DenomCapacity { } } /// LimiterCapacity contains a pair of limiter and its corresponding capacity. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LimiterCapacity { #[prost(message, optional, tag = "1")] @@ -95,7 +91,6 @@ impl ::prost::Name for LimiterCapacity { } } /// GenesisState defines the ratelimit module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// limit_params_list defines the list of `LimitParams` at genesis. @@ -114,7 +109,6 @@ impl ::prost::Name for GenesisState { } /// PendingSendPacket contains the channel_id and sequence pair to identify a /// pending packet -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PendingSendPacket { #[prost(string, tag = "1")] @@ -133,8 +127,7 @@ impl ::prost::Name for PendingSendPacket { } } /// ListLimitParamsRequest is a request type of the ListLimitParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ListLimitParamsRequest {} impl ::prost::Name for ListLimitParamsRequest { const NAME: &'static str = "ListLimitParamsRequest"; @@ -147,7 +140,6 @@ impl ::prost::Name for ListLimitParamsRequest { } } /// ListLimitParamsResponse is a response type of the ListLimitParams RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListLimitParamsResponse { #[prost(message, repeated, tag = "1")] @@ -165,7 +157,6 @@ impl ::prost::Name for ListLimitParamsResponse { } /// QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCapacityByDenomRequest { #[prost(string, tag = "1")] @@ -183,7 +174,6 @@ impl ::prost::Name for QueryCapacityByDenomRequest { } /// QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCapacityByDenomResponse { #[prost(message, repeated, tag = "1")] @@ -201,8 +191,7 @@ impl ::prost::Name for QueryCapacityByDenomResponse { } /// QueryAllPendingSendPacketsRequest is a request type for the /// AllPendingSendPackets RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryAllPendingSendPacketsRequest {} impl ::prost::Name for QueryAllPendingSendPacketsRequest { const NAME: &'static str = "QueryAllPendingSendPacketsRequest"; @@ -216,7 +205,6 @@ impl ::prost::Name for QueryAllPendingSendPacketsRequest { } /// QueryAllPendingSendPacketsResponse is a response type of the /// AllPendingSendPackets RPC -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllPendingSendPacketsResponse { #[prost(message, repeated, tag = "1")] @@ -234,7 +222,13 @@ impl ::prost::Name for QueryAllPendingSendPacketsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -242,6 +236,7 @@ pub mod query_client { 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 @@ -257,8 +252,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -283,7 +278,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -330,8 +325,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -358,8 +352,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -386,8 +379,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -408,7 +400,6 @@ pub mod query_client { } } /// MsgSetLimitParams is the Msg/SetLimitParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetLimitParams { #[prost(string, tag = "1")] @@ -428,8 +419,7 @@ impl ::prost::Name for MsgSetLimitParams { } } /// MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSetLimitParamsResponse {} impl ::prost::Name for MsgSetLimitParamsResponse { const NAME: &'static str = "MsgSetLimitParamsResponse"; @@ -443,7 +433,13 @@ impl ::prost::Name for MsgSetLimitParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -451,6 +447,7 @@ pub mod msg_client { 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 @@ -466,8 +463,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -492,7 +489,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -539,8 +536,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.revshare.rs b/v4-proto-rs/src/dydxprotocol.revshare.rs new file mode 100644 index 0000000000..928c683d74 --- /dev/null +++ b/v4-proto-rs/src/dydxprotocol.revshare.rs @@ -0,0 +1,671 @@ +// This file is @generated by prost-build. +/// MarketMappeRevenueShareParams represents params for the above message +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketMapperRevenueShareParams { + /// The address which will receive the revenue share payouts + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// The fraction of the fees which will go to the above mentioned address. + /// In parts-per-million + #[prost(uint32, tag = "2")] + pub revenue_share_ppm: u32, + /// This parameter defines how many days post market initiation will the + /// revenue share be applied for. After valid_days from market initiation + /// the revenue share goes down to 0 + #[prost(uint32, tag = "3")] + pub valid_days: u32, +} +impl ::prost::Name for MarketMapperRevenueShareParams { + const NAME: &'static str = "MarketMapperRevenueShareParams"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MarketMapperRevenueShareParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MarketMapperRevenueShareParams".into() + } +} +/// GenesisState defines `x/revshare`'s genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.GenesisState".into() + } +} +/// MarketMapperRevShareDetails specifies any details associated with the market +/// mapper revenue share +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MarketMapperRevShareDetails { + /// Unix timestamp recorded when the market revenue share expires + #[prost(uint64, tag = "1")] + pub expiration_ts: u64, +} +impl ::prost::Name for MarketMapperRevShareDetails { + const NAME: &'static str = "MarketMapperRevShareDetails"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MarketMapperRevShareDetails".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MarketMapperRevShareDetails".into() + } +} +/// UnconditionalRevShareConfig stores recipients that +/// receive a share of net revenue unconditionally. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnconditionalRevShareConfig { + /// Configs for each recipient. + #[prost(message, repeated, tag = "1")] + pub configs: ::prost::alloc::vec::Vec< + unconditional_rev_share_config::RecipientConfig, + >, +} +/// Nested message and enum types in `UnconditionalRevShareConfig`. +pub mod unconditional_rev_share_config { + /// Describes the config of a recipient + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct RecipientConfig { + /// Address of the recepient. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Percentage of net revenue to share with recipient, in parts-per-million. + #[prost(uint32, tag = "2")] + pub share_ppm: u32, + } + impl ::prost::Name for RecipientConfig { + const NAME: &'static str = "RecipientConfig"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.UnconditionalRevShareConfig.RecipientConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.UnconditionalRevShareConfig.RecipientConfig".into() + } + } +} +impl ::prost::Name for UnconditionalRevShareConfig { + const NAME: &'static str = "UnconditionalRevShareConfig"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.UnconditionalRevShareConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.UnconditionalRevShareConfig".into() + } +} +/// Queries for the default market mapper revenue share params +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMarketMapperRevenueShareParams {} +impl ::prost::Name for QueryMarketMapperRevenueShareParams { + const NAME: &'static str = "QueryMarketMapperRevenueShareParams"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryMarketMapperRevenueShareParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParams".into() + } +} +/// Response type for QueryMarketMapperRevenueShareParams +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMarketMapperRevenueShareParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryMarketMapperRevenueShareParamsResponse { + const NAME: &'static str = "QueryMarketMapperRevenueShareParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryMarketMapperRevenueShareParamsResponse".into() + } +} +/// Queries market mapper revenue share details for a specific market +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMarketMapperRevShareDetails { + #[prost(uint32, tag = "1")] + pub market_id: u32, +} +impl ::prost::Name for QueryMarketMapperRevShareDetails { + const NAME: &'static str = "QueryMarketMapperRevShareDetails"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryMarketMapperRevShareDetails".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryMarketMapperRevShareDetails".into() + } +} +/// Response type for QueryMarketMapperRevShareDetails +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMarketMapperRevShareDetailsResponse { + #[prost(message, optional, tag = "1")] + pub details: ::core::option::Option, +} +impl ::prost::Name for QueryMarketMapperRevShareDetailsResponse { + const NAME: &'static str = "QueryMarketMapperRevShareDetailsResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryMarketMapperRevShareDetailsResponse".into() + } +} +/// Queries unconditional revenue share details +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryUnconditionalRevShareConfig {} +impl ::prost::Name for QueryUnconditionalRevShareConfig { + const NAME: &'static str = "QueryUnconditionalRevShareConfig"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryUnconditionalRevShareConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryUnconditionalRevShareConfig".into() + } +} +/// Response type for QueryUnconditionalRevShareConfig +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUnconditionalRevShareConfigResponse { + #[prost(message, optional, tag = "1")] + pub config: ::core::option::Option, +} +impl ::prost::Name for QueryUnconditionalRevShareConfigResponse { + const NAME: &'static str = "QueryUnconditionalRevShareConfigResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.QueryUnconditionalRevShareConfigResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.QueryUnconditionalRevShareConfigResponse".into() + } +} +/// Generated client implementations. +pub mod query_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query defines the gRPC querier service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// MarketMapperRevenueShareParams queries the revenue share params for the + /// market mapper + pub async fn market_mapper_revenue_share_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Query/MarketMapperRevenueShareParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Query", + "MarketMapperRevenueShareParams", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Queries market mapper revenue share details for a specific market + pub async fn market_mapper_rev_share_details( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Query/MarketMapperRevShareDetails", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Query", + "MarketMapperRevShareDetails", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Queries unconditional revenue share config + pub async fn unconditional_rev_share_config( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Query/UnconditionalRevShareConfig", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Query", + "UnconditionalRevShareConfig", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Message to set the market mapper revenue share +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetMarketMapperRevenueShare { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Parameters for the revenue share + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgSetMarketMapperRevenueShare { + const NAME: &'static str = "MsgSetMarketMapperRevenueShare"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgSetMarketMapperRevenueShare".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShare".into() + } +} +/// Response to a MsgSetMarketMapperRevenueShare +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetMarketMapperRevenueShareResponse {} +impl ::prost::Name for MsgSetMarketMapperRevenueShareResponse { + const NAME: &'static str = "MsgSetMarketMapperRevenueShareResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgSetMarketMapperRevenueShareResponse".into() + } +} +/// Msg to set market mapper revenue share details (e.g. expiration timestamp) +/// for a specific market. To be used as an override for existing revenue share +/// settings set by the MsgSetMarketMapperRevenueShare msg +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetMarketMapperRevShareDetailsForMarket { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The market ID for which to set the revenue share details + #[prost(uint32, tag = "2")] + pub market_id: u32, + /// Parameters for the revenue share details + #[prost(message, optional, tag = "3")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgSetMarketMapperRevShareDetailsForMarket { + const NAME: &'static str = "MsgSetMarketMapperRevShareDetailsForMarket"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarket".into() + } +} +/// Response to a MsgSetMarketMapperRevShareDetailsForMarket +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetMarketMapperRevShareDetailsForMarketResponse {} +impl ::prost::Name for MsgSetMarketMapperRevShareDetailsForMarketResponse { + const NAME: &'static str = "MsgSetMarketMapperRevShareDetailsForMarketResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgSetMarketMapperRevShareDetailsForMarketResponse" + .into() + } +} +/// Message to update the unconditional revenue share config. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateUnconditionalRevShareConfig { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The config to update. + #[prost(message, optional, tag = "2")] + pub config: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateUnconditionalRevShareConfig { + const NAME: &'static str = "MsgUpdateUnconditionalRevShareConfig"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgUpdateUnconditionalRevShareConfig".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgUpdateUnconditionalRevShareConfig".into() + } +} +/// Response to MsgUpdateUnconditionalRevShareConfig +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateUnconditionalRevShareConfigResponse {} +impl ::prost::Name for MsgUpdateUnconditionalRevShareConfigResponse { + const NAME: &'static str = "MsgUpdateUnconditionalRevShareConfigResponse"; + const PACKAGE: &'static str = "dydxprotocol.revshare"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.revshare.MsgUpdateUnconditionalRevShareConfigResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.revshare.MsgUpdateUnconditionalRevShareConfigResponse".into() + } +} +/// Generated client implementations. +pub mod msg_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Msg defines the Msg service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// SetMarketMapperRevenueShare sets the revenue share for a market + /// mapper. + pub async fn set_market_mapper_revenue_share( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Msg/SetMarketMapperRevenueShare", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Msg", + "SetMarketMapperRevenueShare", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SetMarketMapperRevenueShareDetails sets the revenue share details for a + /// market mapper. + pub async fn set_market_mapper_rev_share_details_for_market( + &mut self, + request: impl tonic::IntoRequest< + super::MsgSetMarketMapperRevShareDetailsForMarket, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Msg/SetMarketMapperRevShareDetailsForMarket", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Msg", + "SetMarketMapperRevShareDetailsForMarket", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateUnconditionalRevShareConfig sets the unconditional revshare config + pub async fn update_unconditional_rev_share_config( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.revshare.Msg/UpdateUnconditionalRevShareConfig", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.revshare.Msg", + "UpdateUnconditionalRevShareConfig", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/v4-proto-rs/src/dydxprotocol.rewards.rs b/v4-proto-rs/src/dydxprotocol.rewards.rs index ec3a05e69f..3f4b88ae33 100644 --- a/v4-proto-rs/src/dydxprotocol.rewards.rs +++ b/v4-proto-rs/src/dydxprotocol.rewards.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. /// Params defines the parameters for x/rewards module. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// The module account to distribute rewards from. @@ -34,7 +33,6 @@ impl ::prost::Name for Params { } } /// GenesisState defines the rewards module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// The parameters of the module. @@ -52,8 +50,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is a request type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; @@ -66,7 +63,6 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is a response type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] @@ -84,7 +80,13 @@ impl ::prost::Name for QueryParamsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -92,6 +94,7 @@ pub mod query_client { 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 @@ -107,8 +110,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -133,7 +136,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -180,8 +183,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -198,7 +200,6 @@ pub mod query_client { } /// RewardShare stores the relative weight of rewards that each address is /// entitled to. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RewardShare { #[prost(string, tag = "1")] @@ -217,7 +218,6 @@ impl ::prost::Name for RewardShare { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { #[prost(string, tag = "1")] @@ -237,8 +237,7 @@ impl ::prost::Name for MsgUpdateParams { } } /// MsgUpdateParamsResponse is the Msg/UpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} impl ::prost::Name for MsgUpdateParamsResponse { const NAME: &'static str = "MsgUpdateParamsResponse"; @@ -252,7 +251,13 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -260,6 +265,7 @@ pub mod msg_client { 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 @@ -275,8 +281,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -301,7 +307,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -348,8 +354,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.sending.rs b/v4-proto-rs/src/dydxprotocol.sending.rs index 7a3bb775b0..a22ff14c4b 100644 --- a/v4-proto-rs/src/dydxprotocol.sending.rs +++ b/v4-proto-rs/src/dydxprotocol.sending.rs @@ -2,8 +2,7 @@ /// GenesisState defines the sending module's genesis state. /// /// this line is used by starport scaffolding # genesis/proto/state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GenesisState {} impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; @@ -17,7 +16,13 @@ impl ::prost::Name for GenesisState { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -25,6 +30,7 @@ pub mod query_client { 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 @@ -40,8 +46,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -66,7 +72,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -104,7 +110,6 @@ pub mod query_client { } } /// Transfer represents a single transfer between two subaccounts. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Transfer { /// The sender subaccount ID. @@ -132,7 +137,6 @@ impl ::prost::Name for Transfer { } /// MsgDepositToSubaccount represents a single transfer from an `x/bank` /// account to an `x/subaccounts` subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositToSubaccount { /// The sender wallet address. @@ -160,7 +164,6 @@ impl ::prost::Name for MsgDepositToSubaccount { } /// MsgWithdrawFromSubaccount represents a single transfer from an /// `x/subaccounts` subaccount to an `x/bank` account. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawFromSubaccount { /// The sender subaccount ID. @@ -190,7 +193,6 @@ impl ::prost::Name for MsgWithdrawFromSubaccount { /// to an `x/bank` account (can be either a module account address or a user /// account address). /// Should only be executed by governance. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendFromModuleToAccount { #[prost(string, tag = "1")] @@ -217,7 +219,6 @@ impl ::prost::Name for MsgSendFromModuleToAccount { } } /// MsgCreateTransfer is a request type used for initiating new transfers. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateTransfer { #[prost(message, optional, tag = "1")] @@ -234,8 +235,7 @@ impl ::prost::Name for MsgCreateTransfer { } } /// MsgCreateTransferResponse is a response type used for new transfers. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCreateTransferResponse {} impl ::prost::Name for MsgCreateTransferResponse { const NAME: &'static str = "MsgCreateTransferResponse"; @@ -249,8 +249,7 @@ impl ::prost::Name for MsgCreateTransferResponse { } /// MsgDepositToSubaccountResponse is a response type used for new /// account-to-subaccount transfers. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDepositToSubaccountResponse {} impl ::prost::Name for MsgDepositToSubaccountResponse { const NAME: &'static str = "MsgDepositToSubaccountResponse"; @@ -264,8 +263,7 @@ impl ::prost::Name for MsgDepositToSubaccountResponse { } /// MsgWithdrawFromSubaccountResponse is a response type used for new /// subaccount-to-account transfers. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgWithdrawFromSubaccountResponse {} impl ::prost::Name for MsgWithdrawFromSubaccountResponse { const NAME: &'static str = "MsgWithdrawFromSubaccountResponse"; @@ -279,8 +277,7 @@ impl ::prost::Name for MsgWithdrawFromSubaccountResponse { } /// MsgSendFromModuleToAccountResponse is a response type used for new /// module-to-account transfers. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSendFromModuleToAccountResponse {} impl ::prost::Name for MsgSendFromModuleToAccountResponse { const NAME: &'static str = "MsgSendFromModuleToAccountResponse"; @@ -294,7 +291,13 @@ impl ::prost::Name for MsgSendFromModuleToAccountResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -302,6 +305,7 @@ pub mod msg_client { 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 @@ -317,8 +321,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -343,7 +347,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -390,8 +394,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -417,8 +420,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -446,8 +448,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -475,8 +476,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.stats.rs b/v4-proto-rs/src/dydxprotocol.stats.rs index 68ec458964..f58d910812 100644 --- a/v4-proto-rs/src/dydxprotocol.stats.rs +++ b/v4-proto-rs/src/dydxprotocol.stats.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// Params defines the parameters for x/stats module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// The desired number of seconds in the look-back window. #[prost(message, optional, tag = "1")] @@ -18,8 +17,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the stats module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GenesisState { /// The parameters of the module. #[prost(message, optional, tag = "1")] @@ -36,7 +34,6 @@ impl ::prost::Name for GenesisState { } } /// BlockStats is used to store stats transiently within the scope of a block. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockStats { /// The fills that occured on this block. @@ -46,7 +43,6 @@ pub struct BlockStats { /// Nested message and enum types in `BlockStats`. pub mod block_stats { /// Fill records data about a fill on this block. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fill { /// Taker wallet address @@ -81,8 +77,7 @@ impl ::prost::Name for BlockStats { } } /// StatsMetadata stores metadata for the x/stats module -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StatsMetadata { /// The oldest epoch that is included in the stats. The next epoch to be /// removed from the window. @@ -100,7 +95,6 @@ impl ::prost::Name for StatsMetadata { } } /// EpochStats stores stats for a particular epoch -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EpochStats { /// Epoch end time @@ -113,7 +107,6 @@ pub struct EpochStats { /// Nested message and enum types in `EpochStats`. pub mod epoch_stats { /// A user and its associated stats - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UserWithStats { #[prost(string, tag = "1")] @@ -143,8 +136,7 @@ impl ::prost::Name for EpochStats { } } /// GlobalStats stores global stats -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GlobalStats { /// Notional USDC traded in quantums #[prost(uint64, tag = "1")] @@ -161,8 +153,7 @@ impl ::prost::Name for GlobalStats { } } /// UserStats stores stats for a User -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UserStats { /// Taker USDC in quantums #[prost(uint64, tag = "1")] @@ -181,9 +172,29 @@ impl ::prost::Name for UserStats { "/dydxprotocol.stats.UserStats".into() } } -/// QueryParamsRequest is a request type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] +/// CachedStakeAmount stores the last calculated total staked amount for address #[derive(Clone, PartialEq, ::prost::Message)] +pub struct CachedStakeAmount { + /// Last calculated total staked amount by the delegator (in coin amount). + #[prost(bytes = "vec", tag = "1")] + pub staked_amount: ::prost::alloc::vec::Vec, + /// Block time at which the calculation is cached (in Unix Epoch seconds) + /// Rounded down to nearest second. + #[prost(int64, tag = "2")] + pub cached_at: i64, +} +impl ::prost::Name for CachedStakeAmount { + const NAME: &'static str = "CachedStakeAmount"; + const PACKAGE: &'static str = "dydxprotocol.stats"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.stats.CachedStakeAmount".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.stats.CachedStakeAmount".into() + } +} +/// QueryParamsRequest is a request type for the Params RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; @@ -196,8 +207,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is a response type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, @@ -213,8 +223,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryStatsMetadataRequest is a request type for the StatsMetadata RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryStatsMetadataRequest {} impl ::prost::Name for QueryStatsMetadataRequest { const NAME: &'static str = "QueryStatsMetadataRequest"; @@ -228,8 +237,7 @@ impl ::prost::Name for QueryStatsMetadataRequest { } /// QueryStatsMetadataResponse is a response type for the StatsMetadata RPC /// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryStatsMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, @@ -245,8 +253,7 @@ impl ::prost::Name for QueryStatsMetadataResponse { } } /// QueryGlobalStatsRequest is a request type for the GlobalStats RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryGlobalStatsRequest {} impl ::prost::Name for QueryGlobalStatsRequest { const NAME: &'static str = "QueryGlobalStatsRequest"; @@ -259,8 +266,7 @@ impl ::prost::Name for QueryGlobalStatsRequest { } } /// QueryGlobalStatsResponse is a response type for the GlobalStats RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryGlobalStatsResponse { #[prost(message, optional, tag = "1")] pub stats: ::core::option::Option, @@ -276,7 +282,6 @@ impl ::prost::Name for QueryGlobalStatsResponse { } } /// QueryUserStatsRequest is a request type for the UserStats RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUserStatsRequest { #[prost(string, tag = "1")] @@ -293,8 +298,7 @@ impl ::prost::Name for QueryUserStatsRequest { } } /// QueryUserStatsResponse is a request type for the UserStats RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryUserStatsResponse { #[prost(message, optional, tag = "1")] pub stats: ::core::option::Option, @@ -311,7 +315,13 @@ impl ::prost::Name for QueryUserStatsResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -319,6 +329,7 @@ pub mod query_client { 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 @@ -334,8 +345,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -360,7 +371,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -407,8 +418,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -433,8 +443,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -459,8 +468,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -485,8 +493,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -502,7 +509,6 @@ pub mod query_client { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { #[prost(string, tag = "1")] @@ -522,8 +528,7 @@ impl ::prost::Name for MsgUpdateParams { } } /// MsgUpdateParamsResponse is the Msg/UpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} impl ::prost::Name for MsgUpdateParamsResponse { const NAME: &'static str = "MsgUpdateParamsResponse"; @@ -537,7 +542,13 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -545,6 +556,7 @@ pub mod msg_client { 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 @@ -560,8 +572,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -586,7 +598,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -633,8 +645,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.subaccounts.rs b/v4-proto-rs/src/dydxprotocol.subaccounts.rs index f08f01ff77..6e2454fdf4 100644 --- a/v4-proto-rs/src/dydxprotocol.subaccounts.rs +++ b/v4-proto-rs/src/dydxprotocol.subaccounts.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// AssetPositions define an account’s positions of an `Asset`. /// Therefore they hold any information needed to trade on Spot and Margin. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AssetPosition { /// The `Id` of the `Asset`. @@ -28,7 +27,6 @@ impl ::prost::Name for AssetPosition { } /// PerpetualPositions are an account’s positions of a `Perpetual`. /// Therefore they hold any information needed to trade perpetuals. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PerpetualPosition { /// The `Id` of the `Perpetual`. @@ -41,6 +39,9 @@ pub struct PerpetualPosition { /// settled. #[prost(bytes = "vec", tag = "3")] pub funding_index: ::prost::alloc::vec::Vec, + /// The quote_balance of the `Perpetual`. + #[prost(bytes = "vec", tag = "4")] + pub quote_balance: ::prost::alloc::vec::Vec, } impl ::prost::Name for PerpetualPosition { const NAME: &'static str = "PerpetualPosition"; @@ -53,7 +54,6 @@ impl ::prost::Name for PerpetualPosition { } } /// SubaccountId defines a unique identifier for a Subaccount. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubaccountId { /// The address of the wallet that owns this subaccount. @@ -76,7 +76,6 @@ impl ::prost::Name for SubaccountId { } /// Subaccount defines a single sub-account for a given address. /// Subaccounts are uniquely indexed by a subaccountNumber/owner pair. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Subaccount { /// The Id of the Subaccount @@ -105,8 +104,83 @@ impl ::prost::Name for Subaccount { "/dydxprotocol.subaccounts.Subaccount".into() } } +/// StreamSubaccountUpdate provides information on a subaccount update. Used in +/// the full node GRPC stream. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamSubaccountUpdate { + #[prost(message, optional, tag = "1")] + pub subaccount_id: ::core::option::Option, + /// updated_perpetual_positions will each be for unique perpetuals. + #[prost(message, repeated, tag = "2")] + pub updated_perpetual_positions: ::prost::alloc::vec::Vec< + SubaccountPerpetualPosition, + >, + /// updated_asset_positions will each be for unique assets. + #[prost(message, repeated, tag = "3")] + pub updated_asset_positions: ::prost::alloc::vec::Vec, + /// Snapshot indicates if the response is from a snapshot of the subaccount. + /// All updates should be ignored until snapshot is received. + /// If the snapshot is true, then all previous entries should be + /// discarded and the subaccount should be resynced. + /// For a snapshot subaccount update, the `updated_perpetual_positions` and + /// `updated_asset_positions` fields will contain the full state of the + /// subaccount. + #[prost(bool, tag = "4")] + pub snapshot: bool, +} +impl ::prost::Name for StreamSubaccountUpdate { + const NAME: &'static str = "StreamSubaccountUpdate"; + const PACKAGE: &'static str = "dydxprotocol.subaccounts"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.subaccounts.StreamSubaccountUpdate".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.subaccounts.StreamSubaccountUpdate".into() + } +} +/// SubaccountPerpetualPosition provides information on a subaccount's updated +/// perpetual positions. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SubaccountPerpetualPosition { + /// The `Id` of the `Perpetual`. + #[prost(uint32, tag = "1")] + pub perpetual_id: u32, + /// The size of the position in base quantums. Negative means short. + #[prost(int64, tag = "2")] + pub quantums: i64, +} +impl ::prost::Name for SubaccountPerpetualPosition { + const NAME: &'static str = "SubaccountPerpetualPosition"; + const PACKAGE: &'static str = "dydxprotocol.subaccounts"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.subaccounts.SubaccountPerpetualPosition".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.subaccounts.SubaccountPerpetualPosition".into() + } +} +/// SubaccountAssetPosition provides information on a subaccount's updated asset +/// positions. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SubaccountAssetPosition { + /// The `Id` of the `Asset`. + #[prost(uint32, tag = "1")] + pub asset_id: u32, + /// The absolute size of the position in base quantums. + #[prost(uint64, tag = "2")] + pub quantums: u64, +} +impl ::prost::Name for SubaccountAssetPosition { + const NAME: &'static str = "SubaccountAssetPosition"; + const PACKAGE: &'static str = "dydxprotocol.subaccounts"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.subaccounts.SubaccountAssetPosition".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.subaccounts.SubaccountAssetPosition".into() + } +} /// GenesisState defines the subaccounts module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] @@ -123,7 +197,6 @@ impl ::prost::Name for GenesisState { } } /// QueryGetSubaccountRequest is request type for the Query RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGetSubaccountRequest { #[prost(string, tag = "1")] @@ -142,7 +215,6 @@ impl ::prost::Name for QueryGetSubaccountRequest { } } /// QuerySubaccountResponse is response type for the Query RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubaccountResponse { #[prost(message, optional, tag = "1")] @@ -159,7 +231,6 @@ impl ::prost::Name for QuerySubaccountResponse { } } /// QueryAllSubaccountRequest is request type for the Query RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllSubaccountRequest { #[prost(message, optional, tag = "1")] @@ -178,7 +249,6 @@ impl ::prost::Name for QueryAllSubaccountRequest { } } /// QuerySubaccountAllResponse is response type for the Query RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubaccountAllResponse { #[prost(message, repeated, tag = "1")] @@ -201,8 +271,7 @@ impl ::prost::Name for QuerySubaccountAllResponse { /// QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for /// fetching information about whether withdrawals and transfers are blocked for /// a collateral pool associated with the passed in perpetual id. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryGetWithdrawalAndTransfersBlockedInfoRequest { #[prost(uint32, tag = "1")] pub perpetual_id: u32, @@ -221,8 +290,7 @@ impl ::prost::Name for QueryGetWithdrawalAndTransfersBlockedInfoRequest { } /// QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for /// fetching information about whether withdrawals and transfers are blocked. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryGetWithdrawalAndTransfersBlockedInfoResponse { #[prost(uint32, tag = "1")] pub negative_tnc_subaccount_seen_at_block: u32, @@ -246,8 +314,7 @@ impl ::prost::Name for QueryGetWithdrawalAndTransfersBlockedInfoResponse { /// QueryCollateralPoolAddressRequest is the request type for fetching the /// account address of the collateral pool associated with the passed in /// perpetual id. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryCollateralPoolAddressRequest { #[prost(uint32, tag = "1")] pub perpetual_id: u32, @@ -265,7 +332,6 @@ impl ::prost::Name for QueryCollateralPoolAddressRequest { /// QueryCollateralPoolAddressResponse is a response type for fetching the /// account address of the collateral pool associated with the passed in /// perpetual id. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCollateralPoolAddressResponse { #[prost(string, tag = "1")] @@ -283,7 +349,13 @@ impl ::prost::Name for QueryCollateralPoolAddressResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -291,6 +363,7 @@ pub mod query_client { 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 @@ -306,8 +379,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -332,7 +405,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -379,8 +452,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -405,8 +477,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -436,8 +507,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -467,8 +537,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/dydxprotocol.vault.rs b/v4-proto-rs/src/dydxprotocol.vault.rs index 9cf8e3d256..74d5479b67 100644 --- a/v4-proto-rs/src/dydxprotocol.vault.rs +++ b/v4-proto-rs/src/dydxprotocol.vault.rs @@ -1,6 +1,198 @@ // This file is @generated by prost-build. -/// Params stores `x/vault` parameters. -#[allow(clippy::derive_partial_eq_without_eq)] +/// VaultId uniquely identifies a vault by its type and number. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct VaultId { + /// Type of the vault. + #[prost(enumeration = "VaultType", tag = "1")] + pub r#type: i32, + /// Unique ID of the vault within above type. + #[prost(uint32, tag = "2")] + pub number: u32, +} +impl ::prost::Name for VaultId { + const NAME: &'static str = "VaultId"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.VaultId".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.VaultId".into() + } +} +/// VaultType represents different types of vaults. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VaultType { + /// Default value, invalid and unused. + Unspecified = 0, + /// Vault is associated with a CLOB pair. + Clob = 1, +} +impl VaultType { + /// 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 { + Self::Unspecified => "VAULT_TYPE_UNSPECIFIED", + Self::Clob => "VAULT_TYPE_CLOB", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VAULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "VAULT_TYPE_CLOB" => Some(Self::Clob), + _ => None, + } + } +} +/// VaultStatus represents the status of a vault. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VaultStatus { + /// Default value, invalid and unused. + Unspecified = 0, + /// Don’t place orders. Does not count toward global vault balances. + /// A vault can only be set to this status if its equity is non-positive. + Deactivated = 1, + /// Don’t place orders. Does count towards global vault balances. + StandBy = 2, + /// Places orders on both sides of the book. + Quoting = 3, + /// Only place orders that close the position. + CloseOnly = 4, +} +impl VaultStatus { + /// 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 { + Self::Unspecified => "VAULT_STATUS_UNSPECIFIED", + Self::Deactivated => "VAULT_STATUS_DEACTIVATED", + Self::StandBy => "VAULT_STATUS_STAND_BY", + Self::Quoting => "VAULT_STATUS_QUOTING", + Self::CloseOnly => "VAULT_STATUS_CLOSE_ONLY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VAULT_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "VAULT_STATUS_DEACTIVATED" => Some(Self::Deactivated), + "VAULT_STATUS_STAND_BY" => Some(Self::StandBy), + "VAULT_STATUS_QUOTING" => Some(Self::Quoting), + "VAULT_STATUS_CLOSE_ONLY" => Some(Self::CloseOnly), + _ => None, + } + } +} +/// QuotingParams stores vault quoting parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuotingParams { + /// The number of layers of orders a vault places. For example if + /// `layers=2`, a vault places 2 asks and 2 bids. + #[prost(uint32, tag = "1")] + pub layers: u32, + /// The minimum base spread when a vault quotes around reservation price. + #[prost(uint32, tag = "2")] + pub spread_min_ppm: u32, + /// The buffer amount to add to min_price_change_ppm to arrive at `spread` + /// according to formula: + /// `spread = max(spread_min_ppm, min_price_change_ppm + spread_buffer_ppm)`. + #[prost(uint32, tag = "3")] + pub spread_buffer_ppm: u32, + /// The factor that determines how aggressive a vault skews its orders. + #[prost(uint32, tag = "4")] + pub skew_factor_ppm: u32, + /// The percentage of vault equity that each order is sized at. + #[prost(uint32, tag = "5")] + pub order_size_pct_ppm: u32, + /// The duration that a vault's orders are valid for. + #[prost(uint32, tag = "6")] + pub order_expiration_seconds: u32, + /// The number of quote quantums in quote asset that a vault with no perpetual + /// positions must have to activate, i.e. if a vault has no perpetual positions + /// and has strictly less than this amount of quote asset, it will not + /// activate. + #[prost(bytes = "vec", tag = "7")] + pub activation_threshold_quote_quantums: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QuotingParams { + const NAME: &'static str = "QuotingParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QuotingParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QuotingParams".into() + } +} +/// VaultParams stores vault parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VaultParams { + /// Status of the vault. + #[prost(enumeration = "VaultStatus", tag = "1")] + pub status: i32, + /// Quoting parameters of the vault. + #[prost(message, optional, tag = "2")] + pub quoting_params: ::core::option::Option, +} +impl ::prost::Name for VaultParams { + const NAME: &'static str = "VaultParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.VaultParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.VaultParams".into() + } +} +/// OperatorParams stores parameters regarding megavault operator. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OperatorParams { + /// Address of the operator. + #[prost(string, tag = "1")] + pub operator: ::prost::alloc::string::String, + /// Metadata of the operator. + #[prost(message, optional, tag = "2")] + pub metadata: ::core::option::Option, +} +impl ::prost::Name for OperatorParams { + const NAME: &'static str = "OperatorParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.OperatorParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.OperatorParams".into() + } +} +/// OperatorMetadata stores metadata regarding megavault operator. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OperatorMetadata { + /// Name of the operator. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Description of the operator. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +impl ::prost::Name for OperatorMetadata { + const NAME: &'static str = "OperatorMetadata"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.OperatorMetadata".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.OperatorMetadata".into() + } +} +/// Deprecated: Params stores `x/vault` parameters. +/// Deprecated since v6.x as is replaced by QuotingParams. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// The number of layers of orders a vault places. For example if @@ -41,13 +233,103 @@ impl ::prost::Name for Params { "/dydxprotocol.vault.Params".into() } } +/// NumShares represents the number of shares. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NumShares { + /// Number of shares. + #[prost(bytes = "vec", tag = "2")] + pub num_shares: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for NumShares { + const NAME: &'static str = "NumShares"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.NumShares".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.NumShares".into() + } +} +/// OwnerShare is a type for owner shares. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OwnerShare { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub shares: ::core::option::Option, +} +impl ::prost::Name for OwnerShare { + const NAME: &'static str = "OwnerShare"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.OwnerShare".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.OwnerShare".into() + } +} +/// OwnerShareUnlocks stores share unlocks for an owner. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OwnerShareUnlocks { + /// Address of the owner of below shares. + #[prost(string, tag = "1")] + pub owner_address: ::prost::alloc::string::String, + /// All share unlocks. + #[prost(message, repeated, tag = "2")] + pub share_unlocks: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for OwnerShareUnlocks { + const NAME: &'static str = "OwnerShareUnlocks"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.OwnerShareUnlocks".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.OwnerShareUnlocks".into() + } +} +/// ShareUnlock stores a single instance of `shares` number of shares +/// unlocking at block height `unlock_block_height`. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ShareUnlock { + /// Number of shares to unlock. + #[prost(message, optional, tag = "1")] + pub shares: ::core::option::Option, + /// Block height at which above shares unlock. + #[prost(uint32, tag = "2")] + pub unlock_block_height: u32, +} +impl ::prost::Name for ShareUnlock { + const NAME: &'static str = "ShareUnlock"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.ShareUnlock".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.ShareUnlock".into() + } +} /// GenesisState defines `x/vault`'s genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// The parameters of the module. + /// The total number of shares, including any locked ones. #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, + pub total_shares: ::core::option::Option, + /// The shares of each owner, including any locked ones. + #[prost(message, repeated, tag = "2")] + pub owner_shares: ::prost::alloc::vec::Vec, + /// The vaults. + #[prost(message, repeated, tag = "3")] + pub vaults: ::prost::alloc::vec::Vec, + /// The default quoting parameters for all vaults. + #[prost(message, optional, tag = "4")] + pub default_quoting_params: ::core::option::Option, + /// All owner share unlocks. + #[prost(message, repeated, tag = "5")] + pub all_owner_share_unlocks: ::prost::alloc::vec::Vec, + /// The parameters regarding megavault operator. + #[prost(message, optional, tag = "6")] + pub operator_params: ::core::option::Option, } impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; @@ -59,77 +341,82 @@ impl ::prost::Name for GenesisState { "/dydxprotocol.vault.GenesisState".into() } } -/// VaultId uniquely identifies a vault by its type and number. -#[allow(clippy::derive_partial_eq_without_eq)] +/// Vault defines the state of a vault. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct VaultId { - /// Type of the vault. - #[prost(enumeration = "VaultType", tag = "1")] - pub r#type: i32, - /// Unique ID of the vault within above type. - #[prost(uint32, tag = "2")] - pub number: u32, +pub struct Vault { + /// The ID of the vault. + #[prost(message, optional, tag = "1")] + pub vault_id: ::core::option::Option, + /// The parameters of the vault. + #[prost(message, optional, tag = "2")] + pub vault_params: ::core::option::Option, + /// The client IDs of the most recently placed orders of the vault. + #[prost(uint32, repeated, tag = "3")] + pub most_recent_client_ids: ::prost::alloc::vec::Vec, } -impl ::prost::Name for VaultId { - const NAME: &'static str = "VaultId"; +impl ::prost::Name for Vault { + const NAME: &'static str = "Vault"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.VaultId".into() + "dydxprotocol.vault.Vault".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.VaultId".into() + "/dydxprotocol.vault.Vault".into() } } -/// NumShares represents the number of shares in a vault. -#[allow(clippy::derive_partial_eq_without_eq)] +/// GenesisStateV6 defines `x/vault`'s genesis state in v6.x. +/// Deprecated since v7.x in favor of GenesisState. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct NumShares { - /// Number of shares. - #[prost(bytes = "vec", tag = "2")] - pub num_shares: ::prost::alloc::vec::Vec, +pub struct GenesisStateV6 { + /// The vaults. + #[prost(message, repeated, tag = "2")] + pub vaults: ::prost::alloc::vec::Vec, + /// The default quoting parameters for all vaults. + #[prost(message, optional, tag = "3")] + pub default_quoting_params: ::core::option::Option, } -impl ::prost::Name for NumShares { - const NAME: &'static str = "NumShares"; +impl ::prost::Name for GenesisStateV6 { + const NAME: &'static str = "GenesisStateV6"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.NumShares".into() + "dydxprotocol.vault.GenesisStateV6".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.NumShares".into() + "/dydxprotocol.vault.GenesisStateV6".into() } } -/// VaultType represents different types of vaults. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VaultType { - /// Default value, invalid and unused. - Unspecified = 0, - /// Vault is associated with a CLOB pair. - Clob = 1, +/// VaultV6 defines the state of a vault. +/// Deprecated since v7.x in favor of Vault. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VaultV6 { + /// The ID of the vault. + #[prost(message, optional, tag = "1")] + pub vault_id: ::core::option::Option, + /// The total number of shares in the vault. + #[prost(message, optional, tag = "2")] + pub total_shares: ::core::option::Option, + /// The shares of each owner in the vault. + #[prost(message, repeated, tag = "3")] + pub owner_shares: ::prost::alloc::vec::Vec, + /// The parameters of the vault. + #[prost(message, optional, tag = "4")] + pub vault_params: ::core::option::Option, + /// The client IDs of the most recently placed orders of the vault. + #[prost(uint32, repeated, tag = "5")] + pub most_recent_client_ids: ::prost::alloc::vec::Vec, } -impl VaultType { - /// 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 { - VaultType::Unspecified => "VAULT_TYPE_UNSPECIFIED", - VaultType::Clob => "VAULT_TYPE_CLOB", - } +impl ::prost::Name for VaultV6 { + const NAME: &'static str = "VaultV6"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.VaultV6".into() } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "VAULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "VAULT_TYPE_CLOB" => Some(Self::Clob), - _ => None, - } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.VaultV6".into() } } /// QueryParamsRequest is a request type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; @@ -142,11 +429,12 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is a response type for the Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, + pub default_quoting_params: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub operator_params: ::core::option::Option, } impl ::prost::Name for QueryParamsResponse { const NAME: &'static str = "QueryParamsResponse"; @@ -159,8 +447,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryVaultRequest is a request type for the Vault RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryVaultRequest { #[prost(enumeration = "VaultType", tag = "1")] pub r#type: i32, @@ -178,19 +465,20 @@ impl ::prost::Name for QueryVaultRequest { } } /// QueryVaultResponse is a response type for the Vault RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVaultResponse { #[prost(message, optional, tag = "1")] pub vault_id: ::core::option::Option, #[prost(message, optional, tag = "2")] pub subaccount_id: ::core::option::Option, - #[prost(uint64, tag = "3")] - pub equity: u64, - #[prost(uint64, tag = "4")] - pub inventory: u64, - #[prost(uint64, tag = "5")] - pub total_shares: u64, + #[prost(bytes = "vec", tag = "3")] + pub equity: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + pub inventory: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub vault_params: ::core::option::Option, + #[prost(uint32, repeated, tag = "6")] + pub most_recent_client_ids: ::prost::alloc::vec::Vec, } impl ::prost::Name for QueryVaultResponse { const NAME: &'static str = "QueryVaultResponse"; @@ -203,7 +491,6 @@ impl ::prost::Name for QueryVaultResponse { } } /// QueryAllVaultsRequest is a request type for the AllVaults RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllVaultsRequest { #[prost(message, optional, tag = "1")] @@ -211,111 +498,897 @@ pub struct QueryAllVaultsRequest { super::super::cosmos::base::query::v1beta1::PageRequest, >, } -impl ::prost::Name for QueryAllVaultsRequest { - const NAME: &'static str = "QueryAllVaultsRequest"; +impl ::prost::Name for QueryAllVaultsRequest { + const NAME: &'static str = "QueryAllVaultsRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryAllVaultsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryAllVaultsRequest".into() + } +} +/// QueryAllVaultsResponse is a response type for the AllVaults RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllVaultsResponse { + #[prost(message, repeated, tag = "1")] + pub vaults: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryAllVaultsResponse { + const NAME: &'static str = "QueryAllVaultsResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryAllVaultsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryAllVaultsResponse".into() + } +} +/// QueryMegavaultTotalSharesRequest is a request type for the +/// MegavaultTotalShares RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryMegavaultTotalSharesRequest {} +impl ::prost::Name for QueryMegavaultTotalSharesRequest { + const NAME: &'static str = "QueryMegavaultTotalSharesRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultTotalSharesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultTotalSharesRequest".into() + } +} +/// QueryMegavaultTotalSharesResponse is a response type for the +/// MegavaultTotalShares RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultTotalSharesResponse { + #[prost(message, optional, tag = "1")] + pub total_shares: ::core::option::Option, +} +impl ::prost::Name for QueryMegavaultTotalSharesResponse { + const NAME: &'static str = "QueryMegavaultTotalSharesResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultTotalSharesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultTotalSharesResponse".into() + } +} +/// QueryMegavaultOwnerSharesRequest is a request type for the +/// MegavaultOwnerShares RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultOwnerSharesRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryMegavaultOwnerSharesRequest { + const NAME: &'static str = "QueryMegavaultOwnerSharesRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultOwnerSharesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultOwnerSharesRequest".into() + } +} +/// QueryMegavaultOwnerSharesResponse is a response type for the +/// MegavaultOwnerShares RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultOwnerSharesResponse { + /// Owner address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Total number of shares that belong to the owner. + #[prost(message, optional, tag = "2")] + pub shares: ::core::option::Option, + /// All share unlocks. + #[prost(message, repeated, tag = "3")] + pub share_unlocks: ::prost::alloc::vec::Vec, + /// Owner equity in megavault (in quote quantums). + #[prost(bytes = "vec", tag = "4")] + pub equity: ::prost::alloc::vec::Vec, + /// Equity that owner can withdraw in quote quantums (as one cannot + /// withdraw locked shares). + #[prost(bytes = "vec", tag = "5")] + pub withdrawable_equity: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryMegavaultOwnerSharesResponse { + const NAME: &'static str = "QueryMegavaultOwnerSharesResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultOwnerSharesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultOwnerSharesResponse".into() + } +} +/// QueryMegavaultAllOwnerSharesRequest is a request type for the +/// MegavaultAllOwnerShares RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultAllOwnerSharesRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryMegavaultAllOwnerSharesRequest { + const NAME: &'static str = "QueryMegavaultAllOwnerSharesRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultAllOwnerSharesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultAllOwnerSharesRequest".into() + } +} +/// QueryMegavaultAllOwnerSharesResponse is a response type for the +/// MegavaultAllOwnerShares RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultAllOwnerSharesResponse { + #[prost(message, repeated, tag = "1")] + pub owner_shares: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryMegavaultAllOwnerSharesResponse { + const NAME: &'static str = "QueryMegavaultAllOwnerSharesResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultAllOwnerSharesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultAllOwnerSharesResponse".into() + } +} +/// QueryVaultParamsRequest is a request for the VaultParams RPC method. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryVaultParamsRequest { + #[prost(enumeration = "VaultType", tag = "1")] + pub r#type: i32, + #[prost(uint32, tag = "2")] + pub number: u32, +} +impl ::prost::Name for QueryVaultParamsRequest { + const NAME: &'static str = "QueryVaultParamsRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryVaultParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryVaultParamsRequest".into() + } +} +/// QueryVaultParamsResponse is a response for the VaultParams RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVaultParamsResponse { + #[prost(message, optional, tag = "1")] + pub vault_id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub vault_params: ::core::option::Option, +} +impl ::prost::Name for QueryVaultParamsResponse { + const NAME: &'static str = "QueryVaultParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryVaultParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryVaultParamsResponse".into() + } +} +/// QueryMegavaultWithdrawalInfoRequest is a request type for the +/// MegavaultWithdrawalInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultWithdrawalInfoRequest { + /// Number of shares to withdraw. + #[prost(message, optional, tag = "1")] + pub shares_to_withdraw: ::core::option::Option, +} +impl ::prost::Name for QueryMegavaultWithdrawalInfoRequest { + const NAME: &'static str = "QueryMegavaultWithdrawalInfoRequest"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultWithdrawalInfoRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultWithdrawalInfoRequest".into() + } +} +/// QueryMegavaultWithdrawalInfoResponse is a response type for the +/// MegavaultWithdrawalInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryMegavaultWithdrawalInfoResponse { + /// Number of shares to withdraw. + #[prost(message, optional, tag = "1")] + pub shares_to_withdraw: ::core::option::Option, + /// Number of quote quantums above `shares` are expected to redeem. + /// Withdrawl slippage can be calculated by comparing + /// `expected_quote_quantums` with + /// `megavault_equity * shares_to_withdraw / total_shares` + #[prost(bytes = "vec", tag = "2")] + pub expected_quote_quantums: ::prost::alloc::vec::Vec, + /// Equity of megavault (in quote quantums). + #[prost(bytes = "vec", tag = "3")] + pub megavault_equity: ::prost::alloc::vec::Vec, + /// Total shares in megavault. + #[prost(message, optional, tag = "4")] + pub total_shares: ::core::option::Option, +} +impl ::prost::Name for QueryMegavaultWithdrawalInfoResponse { + const NAME: &'static str = "QueryMegavaultWithdrawalInfoResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.QueryMegavaultWithdrawalInfoResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.QueryMegavaultWithdrawalInfoResponse".into() + } +} +/// Generated client implementations. +pub mod query_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query defines the gRPC querier service. + #[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 + std::marker::Send + 'static, + ::Error: Into + std::marker::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 + std::marker::Send + std::marker::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 + } + /// Queries the Params. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /// Queries a Vault by type and number. + pub async fn vault( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/Vault", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Query", "Vault")); + self.inner.unary(req, path, codec).await + } + /// Queries all vaults. + pub async fn all_vaults( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/AllVaults", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Query", "AllVaults")); + self.inner.unary(req, path, codec).await + } + /// Queries total shares of megavault. + pub async fn megavault_total_shares( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/MegavaultTotalShares", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.vault.Query", "MegavaultTotalShares"), + ); + self.inner.unary(req, path, codec).await + } + /// Queries owner shares of megavault. + pub async fn megavault_owner_shares( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/MegavaultOwnerShares", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("dydxprotocol.vault.Query", "MegavaultOwnerShares"), + ); + self.inner.unary(req, path, codec).await + } + /// Queries all owner shares of megavault. + pub async fn megavault_all_owner_shares( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/MegavaultAllOwnerShares", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.vault.Query", + "MegavaultAllOwnerShares", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Queries vault params of a vault. + pub async fn vault_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/VaultParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Query", "VaultParams")); + self.inner.unary(req, path, codec).await + } + /// Queries withdrawal info for megavault. + pub async fn megavault_withdrawal_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Query/MegavaultWithdrawalInfo", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "dydxprotocol.vault.Query", + "MegavaultWithdrawalInfo", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// MsgDepositToMegavault deposits the specified asset from the subaccount to +/// megavault. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDepositToMegavault { + /// The subaccount to deposit from. + #[prost(message, optional, tag = "1")] + pub subaccount_id: ::core::option::Option, + /// Number of quote quantums to deposit. + #[prost(bytes = "vec", tag = "2")] + pub quote_quantums: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgDepositToMegavault { + const NAME: &'static str = "MsgDepositToMegavault"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgDepositToMegavault".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgDepositToMegavault".into() + } +} +/// MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDepositToMegavaultResponse { + /// The number of shares minted from the deposit. + #[prost(message, optional, tag = "1")] + pub minted_shares: ::core::option::Option, +} +impl ::prost::Name for MsgDepositToMegavaultResponse { + const NAME: &'static str = "MsgDepositToMegavaultResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgDepositToMegavaultResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgDepositToMegavaultResponse".into() + } +} +/// MsgWithdrawFromMegavault withdraws the specified shares from megavault to +/// a subaccount. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawFromMegavault { + /// The subaccount to withdraw to. + #[prost(message, optional, tag = "1")] + pub subaccount_id: ::core::option::Option, + /// Number of shares to withdraw. + #[prost(message, optional, tag = "2")] + pub shares: ::core::option::Option, + /// The minimum number of quote quantums above shares should redeem, i.e. + /// transaction fails if above shares redeem less than min_quote_quantums. + #[prost(bytes = "vec", tag = "3")] + pub min_quote_quantums: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgWithdrawFromMegavault { + const NAME: &'static str = "MsgWithdrawFromMegavault"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgWithdrawFromMegavault".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgWithdrawFromMegavault".into() + } +} +/// MsgWithdrawFromMegavaultResponse is the Msg/WithdrawFromMegavault response +/// type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawFromMegavaultResponse { + /// The number of quote quantums redeemed from the withdrawal. + #[prost(bytes = "vec", tag = "1")] + pub quote_quantums: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgWithdrawFromMegavaultResponse { + const NAME: &'static str = "MsgWithdrawFromMegavaultResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgWithdrawFromMegavaultResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgWithdrawFromMegavaultResponse".into() + } +} +/// MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request +/// type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateDefaultQuotingParams { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The quoting parameters to update to. Every field must be set. + #[prost(message, optional, tag = "2")] + pub default_quoting_params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateDefaultQuotingParams { + const NAME: &'static str = "MsgUpdateDefaultQuotingParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUpdateDefaultQuotingParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUpdateDefaultQuotingParams".into() + } +} +/// MsgUpdateDefaultQuotingParamsResponse is the Msg/UpdateDefaultQuotingParams +/// response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateDefaultQuotingParamsResponse {} +impl ::prost::Name for MsgUpdateDefaultQuotingParamsResponse { + const NAME: &'static str = "MsgUpdateDefaultQuotingParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUpdateDefaultQuotingParamsResponse".into() + } +} +/// MsgSetVaultParams is the Msg/SetVaultParams request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetVaultParams { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The vault to set params of. + #[prost(message, optional, tag = "2")] + pub vault_id: ::core::option::Option, + /// The parameters to set. + #[prost(message, optional, tag = "3")] + pub vault_params: ::core::option::Option, +} +impl ::prost::Name for MsgSetVaultParams { + const NAME: &'static str = "MsgSetVaultParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgSetVaultParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgSetVaultParams".into() + } +} +/// MsgSetVaultParamsResponse is the Msg/SetVaultParams response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgSetVaultParamsResponse {} +impl ::prost::Name for MsgSetVaultParamsResponse { + const NAME: &'static str = "MsgSetVaultParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgSetVaultParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgSetVaultParamsResponse".into() + } +} +/// MsgUnlockShares is the Msg/UnlockShares request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUnlockShares { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Address of the owner to unlock shares of. + #[prost(string, tag = "2")] + pub owner_address: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgUnlockShares { + const NAME: &'static str = "MsgUnlockShares"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUnlockShares".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUnlockShares".into() + } +} +/// MsgUnlockSharesResponse is the Msg/UnlockShares response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUnlockSharesResponse { + /// The number of shares unlocked. + #[prost(message, optional, tag = "1")] + pub unlocked_shares: ::core::option::Option, +} +impl ::prost::Name for MsgUnlockSharesResponse { + const NAME: &'static str = "MsgUnlockSharesResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUnlockSharesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUnlockSharesResponse".into() + } +} +/// MsgUpdateOperatorParams is the Msg/UpdateOperatorParams request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateOperatorParams { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Operator parameters to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateOperatorParams { + const NAME: &'static str = "MsgUpdateOperatorParams"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUpdateOperatorParams".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUpdateOperatorParams".into() + } +} +/// MsgUpdateVaultParamsResponse is the Msg/UpdateOperatorParams response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgUpdateOperatorParamsResponse {} +impl ::prost::Name for MsgUpdateOperatorParamsResponse { + const NAME: &'static str = "MsgUpdateOperatorParamsResponse"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgUpdateOperatorParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgUpdateOperatorParamsResponse".into() + } +} +/// MsgAllocateToVault is the Msg/AllocateToVault request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAllocateToVault { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The vault to allocate to. + #[prost(message, optional, tag = "2")] + pub vault_id: ::core::option::Option, + /// Number of quote quantums to allocate. + #[prost(bytes = "vec", tag = "3")] + pub quote_quantums: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgAllocateToVault { + const NAME: &'static str = "MsgAllocateToVault"; + const PACKAGE: &'static str = "dydxprotocol.vault"; + fn full_name() -> ::prost::alloc::string::String { + "dydxprotocol.vault.MsgAllocateToVault".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/dydxprotocol.vault.MsgAllocateToVault".into() + } +} +/// MsgAllocateToVaultResponse is the Msg/AllocateToVault response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgAllocateToVaultResponse {} +impl ::prost::Name for MsgAllocateToVaultResponse { + const NAME: &'static str = "MsgAllocateToVaultResponse"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.QueryAllVaultsRequest".into() + "dydxprotocol.vault.MsgAllocateToVaultResponse".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.QueryAllVaultsRequest".into() + "/dydxprotocol.vault.MsgAllocateToVaultResponse".into() } } -/// QueryAllVaultsResponse is a response type for the AllVaults RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] +/// MsgRetrieveFromVault is the Msg/RetrieveFromVault request type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllVaultsResponse { - #[prost(message, repeated, tag = "1")] - pub vaults: ::prost::alloc::vec::Vec, +pub struct MsgRetrieveFromVault { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The vault to retrieve from. #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::cosmos::base::query::v1beta1::PageResponse, - >, + pub vault_id: ::core::option::Option, + /// Number of quote quantums to retrieve. + #[prost(bytes = "vec", tag = "3")] + pub quote_quantums: ::prost::alloc::vec::Vec, } -impl ::prost::Name for QueryAllVaultsResponse { - const NAME: &'static str = "QueryAllVaultsResponse"; +impl ::prost::Name for MsgRetrieveFromVault { + const NAME: &'static str = "MsgRetrieveFromVault"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.QueryAllVaultsResponse".into() + "dydxprotocol.vault.MsgRetrieveFromVault".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.QueryAllVaultsResponse".into() + "/dydxprotocol.vault.MsgRetrieveFromVault".into() } } -/// QueryOwnerSharesRequest is a request type for the OwnerShares RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryOwnerSharesRequest { - #[prost(enumeration = "VaultType", tag = "1")] - pub r#type: i32, - #[prost(uint32, tag = "2")] - pub number: u32, - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryOwnerSharesRequest { - const NAME: &'static str = "QueryOwnerSharesRequest"; +/// MsgRetrieveFromVaultResponse is the Msg/RetrieveFromVault response type. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgRetrieveFromVaultResponse {} +impl ::prost::Name for MsgRetrieveFromVaultResponse { + const NAME: &'static str = "MsgRetrieveFromVaultResponse"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.QueryOwnerSharesRequest".into() + "dydxprotocol.vault.MsgRetrieveFromVaultResponse".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.QueryOwnerSharesRequest".into() + "/dydxprotocol.vault.MsgRetrieveFromVaultResponse".into() } } -/// OwnerShare is a type for owner shares in a vault. -#[allow(clippy::derive_partial_eq_without_eq)] +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// Deprecated since v6.x as is replaced by MsgUpdateDefaultQuotingParams. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct OwnerShare { +pub struct MsgUpdateParams { #[prost(string, tag = "1")] - pub owner: ::prost::alloc::string::String, + pub authority: ::prost::alloc::string::String, + /// The parameters to update. Each field must be set. #[prost(message, optional, tag = "2")] - pub shares: ::core::option::Option, + pub params: ::core::option::Option, } -impl ::prost::Name for OwnerShare { - const NAME: &'static str = "OwnerShare"; +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.OwnerShare".into() + "dydxprotocol.vault.MsgUpdateParams".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.OwnerShare".into() + "/dydxprotocol.vault.MsgUpdateParams".into() } } -/// QueryOwnerSharesResponse is a response type for the OwnerShares RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] +/// MsgSetVaultQuotingParams is the Msg/SetVaultQuotingParams request type. +/// Deprecated since v6.x as is replaced by MsgSetVaultParams. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryOwnerSharesResponse { - #[prost(message, repeated, tag = "1")] - pub owner_shares: ::prost::alloc::vec::Vec, +pub struct MsgSetVaultQuotingParams { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// The vault to set quoting params of. #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::cosmos::base::query::v1beta1::PageResponse, - >, + pub vault_id: ::core::option::Option, + /// The quoting parameters to set. Each field must be set. + #[prost(message, optional, tag = "3")] + pub quoting_params: ::core::option::Option, } -impl ::prost::Name for QueryOwnerSharesResponse { - const NAME: &'static str = "QueryOwnerSharesResponse"; +impl ::prost::Name for MsgSetVaultQuotingParams { + const NAME: &'static str = "MsgSetVaultQuotingParams"; const PACKAGE: &'static str = "dydxprotocol.vault"; fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.QueryOwnerSharesResponse".into() + "dydxprotocol.vault.MsgSetVaultQuotingParams".into() } fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.QueryOwnerSharesResponse".into() + "/dydxprotocol.vault.MsgSetVaultQuotingParams".into() } } /// Generated client implementations. -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] +pub mod msg_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service. + /// Msg defines the Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + #[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 @@ -326,12 +1399,12 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -344,7 +1417,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -356,9 +1429,9 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -391,320 +1464,214 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Queries the Params. - pub async fn params( + /// DepositToMegavault deposits funds into megavault. + pub async fn deposit_to_megavault( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Query/Params", + "/dydxprotocol.vault.Msg/DepositToMegavault", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Query", "Params")); + .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "DepositToMegavault")); self.inner.unary(req, path, codec).await } - /// Queries a Vault by type and number. - pub async fn vault( + /// WithdrawFromMegavault withdraws shares from megavault. + pub async fn withdraw_from_megavault( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Query/Vault", + "/dydxprotocol.vault.Msg/WithdrawFromMegavault", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Query", "Vault")); + .insert( + GrpcMethod::new("dydxprotocol.vault.Msg", "WithdrawFromMegavault"), + ); self.inner.unary(req, path, codec).await } - /// Queries all vaults. - pub async fn all_vaults( + /// UpdateDefaultQuotingParams updates the default quoting params in state. + pub async fn update_default_quoting_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Query/AllVaults", + "/dydxprotocol.vault.Msg/UpdateDefaultQuotingParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Query", "AllVaults")); + .insert( + GrpcMethod::new( + "dydxprotocol.vault.Msg", + "UpdateDefaultQuotingParams", + ), + ); self.inner.unary(req, path, codec).await } - /// Queries owner shares of a vault. - pub async fn owner_shares( + /// UpdateOperatorParams sets the parameters regarding megavault operator. + pub async fn update_operator_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Query/OwnerShares", + "/dydxprotocol.vault.Msg/UpdateOperatorParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Query", "OwnerShares")); + .insert( + GrpcMethod::new("dydxprotocol.vault.Msg", "UpdateOperatorParams"), + ); self.inner.unary(req, path, codec).await } - } -} -/// MsgDepositToVault is the Msg/DepositToVault request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDepositToVault { - /// The vault to deposit into. - #[prost(message, optional, tag = "1")] - pub vault_id: ::core::option::Option, - /// The subaccount to deposit from. - #[prost(message, optional, tag = "2")] - pub subaccount_id: ::core::option::Option, - /// Number of quote quantums to deposit. - #[prost(bytes = "vec", tag = "3")] - pub quote_quantums: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for MsgDepositToVault { - const NAME: &'static str = "MsgDepositToVault"; - const PACKAGE: &'static str = "dydxprotocol.vault"; - fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.MsgDepositToVault".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.MsgDepositToVault".into() - } -} -/// MsgDepositToVaultResponse is the Msg/DepositToVault response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDepositToVaultResponse {} -impl ::prost::Name for MsgDepositToVaultResponse { - const NAME: &'static str = "MsgDepositToVaultResponse"; - const PACKAGE: &'static str = "dydxprotocol.vault"; - fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.MsgDepositToVaultResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.MsgDepositToVaultResponse".into() - } -} -/// MsgUpdateParams is the Msg/UpdateParams request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// The parameters to update. Each field must be set. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "dydxprotocol.vault"; - fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.MsgUpdateParams".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.MsgUpdateParams".into() - } -} -/// MsgUpdateParamsResponse is the Msg/UpdateParams response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; - const PACKAGE: &'static str = "dydxprotocol.vault"; - fn full_name() -> ::prost::alloc::string::String { - "dydxprotocol.vault.MsgUpdateParamsResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/dydxprotocol.vault.MsgUpdateParamsResponse".into() - } -} -/// Generated client implementations. -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// Msg defines the Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - 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 + /// SetVaultParams sets the parameters of a specific vault. + pub async fn set_vault_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Msg/SetVaultParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "SetVaultParams")); + self.inner.unary(req, path, codec).await } - /// 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 + /// UnlockShares unlocks an owner's shares that are due to unlock by the block + /// height that this transaction is included in. + pub async fn unlock_shares( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dydxprotocol.vault.Msg/UnlockShares", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "UnlockShares")); + self.inner.unary(req, path, codec).await } - /// DepositToVault deposits funds into a vault. - pub async fn deposit_to_vault( + /// AllocateToVault allocates funds from main vault to a vault. + pub async fn allocate_to_vault( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Msg/DepositToVault", + "/dydxprotocol.vault.Msg/AllocateToVault", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "DepositToVault")); + .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "AllocateToVault")); self.inner.unary(req, path, codec).await } - /// UpdateParams updates the Params in state. - pub async fn update_params( + /// RetrieveFromVault retrieves funds from a vault to main vault. + pub async fn retrieve_from_vault( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/dydxprotocol.vault.Msg/UpdateParams", + "/dydxprotocol.vault.Msg/RetrieveFromVault", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "UpdateParams")); + .insert(GrpcMethod::new("dydxprotocol.vault.Msg", "RetrieveFromVault")); self.inner.unary(req, path, codec).await } } diff --git a/v4-proto-rs/src/dydxprotocol.vest.rs b/v4-proto-rs/src/dydxprotocol.vest.rs index f875d24e7d..34aeb77068 100644 --- a/v4-proto-rs/src/dydxprotocol.vest.rs +++ b/v4-proto-rs/src/dydxprotocol.vest.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// VestEntry specifies a Vester Account and the rate at which tokens are /// dripped into the corresponding Treasury Account. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VestEntry { /// The module account to vest tokens from. @@ -33,7 +32,6 @@ impl ::prost::Name for VestEntry { } } /// GenesisState defines the vest module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// The vest entries at genesis. @@ -51,7 +49,6 @@ impl ::prost::Name for GenesisState { } } /// QueryVestEntryRequest is a request type for the VestEntry RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVestEntryRequest { #[prost(string, tag = "1")] @@ -68,7 +65,6 @@ impl ::prost::Name for QueryVestEntryRequest { } } /// QueryVestEntryResponse is a response type for the VestEntry RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVestEntryResponse { #[prost(message, optional, tag = "1")] @@ -86,7 +82,13 @@ impl ::prost::Name for QueryVestEntryResponse { } /// Generated client implementations. pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Query defines the gRPC querier service. @@ -94,6 +96,7 @@ pub mod query_client { 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 @@ -109,8 +112,8 @@ pub mod query_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -135,7 +138,7 @@ pub mod query_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -182,8 +185,7 @@ pub mod query_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -199,7 +201,6 @@ pub mod query_client { } } /// MsgDeleteVestEntry is the Msg/DeleteVestEntry request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeleteVestEntry { /// authority is the address that controls the module. @@ -220,8 +221,7 @@ impl ::prost::Name for MsgDeleteVestEntry { } } /// MsgDeleteVestEntryResponse is the Msg/DeleteVestEntry response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgDeleteVestEntryResponse {} impl ::prost::Name for MsgDeleteVestEntryResponse { const NAME: &'static str = "MsgDeleteVestEntryResponse"; @@ -234,7 +234,6 @@ impl ::prost::Name for MsgDeleteVestEntryResponse { } } /// MsgSetVestEntry is the Msg/SetVestEntry request type. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetVestEntry { /// authority is the address that controls the module. @@ -255,8 +254,7 @@ impl ::prost::Name for MsgSetVestEntry { } } /// MsgSetVestEntryResponse is the Msg/SetVestEntry response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSetVestEntryResponse {} impl ::prost::Name for MsgSetVestEntryResponse { const NAME: &'static str = "MsgSetVestEntryResponse"; @@ -270,7 +268,13 @@ impl ::prost::Name for MsgSetVestEntryResponse { } /// Generated client implementations. pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Msg defines the Msg service. @@ -278,6 +282,7 @@ pub mod msg_client { 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 @@ -293,8 +298,8 @@ pub mod msg_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -319,7 +324,7 @@ pub mod msg_client { >, , - >>::Error: Into + Send + Sync, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -366,8 +371,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; @@ -392,8 +396,7 @@ pub mod msg_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; diff --git a/v4-proto-rs/src/google.api.rs b/v4-proto-rs/src/google.api.rs index 08318f49cf..89bf932b4f 100644 --- a/v4-proto-rs/src/google.api.rs +++ b/v4-proto-rs/src/google.api.rs @@ -2,7 +2,6 @@ /// Defines the HTTP configuration for an API service. It contains a list of /// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method /// to one or more HTTP REST API methods. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http { /// A list of HTTP configuration rules that apply to individual API methods. @@ -301,7 +300,6 @@ impl ::prost::Name for Http { /// If an API needs to use a JSON array for request or response body, it can map /// the request or response body to a repeated field. However, some gRPC /// Transcoding implementations may not support this feature. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRule { /// Selects a method to which this rule applies. @@ -342,7 +340,6 @@ pub mod http_rule { /// Determines the URL pattern is matched by this rules. This pattern can be /// used with any of the {get|put|post|delete|patch} methods. A custom method /// can be defined using the 'custom' field. - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Pattern { /// Maps to HTTP GET. Used for listing and getting information about @@ -380,7 +377,6 @@ impl ::prost::Name for HttpRule { } } /// A custom pattern is used for defining custom HTTP verb. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CustomHttpPattern { /// The name of this custom HTTP verb. diff --git a/v4-proto-rs/src/lib.rs b/v4-proto-rs/src/lib.rs index 0e372c984a..3e97ff72e1 100644 --- a/v4-proto-rs/src/lib.rs +++ b/v4-proto-rs/src/lib.rs @@ -3,14 +3,15 @@ pub use cosmos_sdk_proto; include!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/_includes.rs")); +use cosmos_sdk_proto::Any; use prost::Name; pub trait ToAny: Name + Sized { /// Converts the type to `prost_types::Any`. - fn to_any(self) -> prost_types::Any { + fn to_any(self) -> Any { let value = self.encode_to_vec(); let type_url = Self::type_url(); - prost_types::Any { type_url, value } + Any { type_url, value } } } @@ -23,8 +24,8 @@ mod test { use crate::dydxprotocol::clob::MsgCancelOrder; #[test] + /// Tests the conversion of `MsgCancelOrder` to `cosmos_sdk_proto::Any`. pub fn test_any_conversion() { - /// Tests the conversion of `MsgCancelOrder` to `prost_types::Any`. let msg = MsgCancelOrder { order_id: None, good_til_oneof: None, @@ -35,8 +36,8 @@ mod test { } #[test] + /// Tests the conversion of `MsgSend` to `cosmos_sdk_proto::Any`. pub fn test_any_conversion_wrapped() { - /// Tests the conversion of `MsgSend` to `prost_types::Any`. let msg = MsgSend::default(); let any = msg.to_any(); let url = "/cosmos.bank.v1beta1.MsgSend";