#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkSwapProof {
#[prost(bytes = "vec", tag = "1")]
pub inner: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ZkSwapProof {
const NAME: &'static str = "ZKSwapProof";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZkSwapClaimProof {
#[prost(bytes = "vec", tag = "1")]
pub inner: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ZkSwapClaimProof {
const NAME: &'static str = "ZKSwapClaimProof";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Swap {
#[prost(message, optional, tag = "1")]
pub proof: ::core::option::Option<ZkSwapProof>,
#[prost(message, optional, tag = "4")]
pub body: ::core::option::Option<SwapBody>,
}
impl ::prost::Name for Swap {
const NAME: &'static str = "Swap";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapClaim {
#[prost(message, optional, tag = "1")]
pub proof: ::core::option::Option<ZkSwapClaimProof>,
#[prost(message, optional, tag = "2")]
pub body: ::core::option::Option<SwapClaimBody>,
#[prost(uint64, tag = "7")]
pub epoch_duration: u64,
}
impl ::prost::Name for SwapClaim {
const NAME: &'static str = "SwapClaim";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapClaimBody {
#[prost(message, optional, tag = "1")]
pub nullifier: ::core::option::Option<super::super::sct::v1::Nullifier>,
#[prost(message, optional, tag = "2")]
pub fee: ::core::option::Option<super::super::fee::v1::Fee>,
#[prost(message, optional, tag = "3")]
pub output_1_commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
#[prost(message, optional, tag = "4")]
pub output_2_commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
#[prost(message, optional, tag = "6")]
pub output_data: ::core::option::Option<BatchSwapOutputData>,
}
impl ::prost::Name for SwapClaimBody {
const NAME: &'static str = "SwapClaimBody";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapBody {
#[prost(message, optional, tag = "1")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "2")]
pub delta_1_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub delta_2_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub fee_commitment: ::core::option::Option<
super::super::super::asset::v1::BalanceCommitment,
>,
#[prost(message, optional, tag = "5")]
pub payload: ::core::option::Option<SwapPayload>,
}
impl ::prost::Name for SwapBody {
const NAME: &'static str = "SwapBody";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapPayload {
#[prost(message, optional, tag = "1")]
pub commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
#[prost(bytes = "vec", tag = "2")]
pub encrypted_swap: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for SwapPayload {
const NAME: &'static str = "SwapPayload";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapPlaintext {
#[prost(message, optional, tag = "1")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "2")]
pub delta_1_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub delta_2_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub claim_fee: ::core::option::Option<super::super::fee::v1::Fee>,
#[prost(message, optional, tag = "5")]
pub claim_address: ::core::option::Option<super::super::super::keys::v1::Address>,
#[prost(bytes = "vec", tag = "6")]
pub rseed: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for SwapPlaintext {
const NAME: &'static str = "SwapPlaintext";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapPlan {
#[prost(message, optional, tag = "1")]
pub swap_plaintext: ::core::option::Option<SwapPlaintext>,
#[prost(bytes = "vec", tag = "2")]
pub fee_blinding: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub proof_blinding_r: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "4")]
pub proof_blinding_s: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for SwapPlan {
const NAME: &'static str = "SwapPlan";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapClaimPlan {
#[prost(message, optional, tag = "1")]
pub swap_plaintext: ::core::option::Option<SwapPlaintext>,
#[prost(uint64, tag = "2")]
pub position: u64,
#[prost(message, optional, tag = "3")]
pub output_data: ::core::option::Option<BatchSwapOutputData>,
#[prost(uint64, tag = "4")]
pub epoch_duration: u64,
#[prost(bytes = "vec", tag = "5")]
pub proof_blinding_r: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "6")]
pub proof_blinding_s: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for SwapClaimPlan {
const NAME: &'static str = "SwapClaimPlan";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapView {
#[prost(oneof = "swap_view::SwapView", tags = "1, 2")]
pub swap_view: ::core::option::Option<swap_view::SwapView>,
}
pub mod swap_view {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Visible {
#[prost(message, optional, tag = "1")]
pub swap: ::core::option::Option<super::Swap>,
#[prost(message, optional, tag = "3")]
pub swap_plaintext: ::core::option::Option<super::SwapPlaintext>,
#[prost(message, optional, tag = "4")]
pub claim_tx: ::core::option::Option<
super::super::super::super::txhash::v1::TransactionId,
>,
#[prost(message, optional, tag = "20")]
pub batch_swap_output_data: ::core::option::Option<super::BatchSwapOutputData>,
#[prost(message, optional, tag = "30")]
pub output_1: ::core::option::Option<
super::super::super::shielded_pool::v1::NoteView,
>,
#[prost(message, optional, tag = "31")]
pub output_2: ::core::option::Option<
super::super::super::shielded_pool::v1::NoteView,
>,
#[prost(message, optional, tag = "40")]
pub asset_1_metadata: ::core::option::Option<
super::super::super::super::asset::v1::Metadata,
>,
#[prost(message, optional, tag = "41")]
pub asset_2_metadata: ::core::option::Option<
super::super::super::super::asset::v1::Metadata,
>,
}
impl ::prost::Name for Visible {
const NAME: &'static str = "Visible";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SwapView.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Opaque {
#[prost(message, optional, tag = "1")]
pub swap: ::core::option::Option<super::Swap>,
#[prost(message, optional, tag = "20")]
pub batch_swap_output_data: ::core::option::Option<super::BatchSwapOutputData>,
#[prost(message, optional, tag = "30")]
pub output_1_value: ::core::option::Option<
super::super::super::super::asset::v1::ValueView,
>,
#[prost(message, optional, tag = "31")]
pub output_2_value: ::core::option::Option<
super::super::super::super::asset::v1::ValueView,
>,
#[prost(message, optional, tag = "40")]
pub asset_1_metadata: ::core::option::Option<
super::super::super::super::asset::v1::Metadata,
>,
#[prost(message, optional, tag = "41")]
pub asset_2_metadata: ::core::option::Option<
super::super::super::super::asset::v1::Metadata,
>,
}
impl ::prost::Name for Opaque {
const NAME: &'static str = "Opaque";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SwapView.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SwapView {
#[prost(message, tag = "1")]
Visible(Visible),
#[prost(message, tag = "2")]
Opaque(Opaque),
}
}
impl ::prost::Name for SwapView {
const NAME: &'static str = "SwapView";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapClaimView {
#[prost(oneof = "swap_claim_view::SwapClaimView", tags = "1, 2")]
pub swap_claim_view: ::core::option::Option<swap_claim_view::SwapClaimView>,
}
pub mod swap_claim_view {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Visible {
#[prost(message, optional, tag = "1")]
pub swap_claim: ::core::option::Option<super::SwapClaim>,
#[prost(message, optional, tag = "2")]
pub output_1: ::core::option::Option<
super::super::super::shielded_pool::v1::NoteView,
>,
#[prost(message, optional, tag = "3")]
pub output_2: ::core::option::Option<
super::super::super::shielded_pool::v1::NoteView,
>,
#[prost(message, optional, tag = "4")]
pub swap_tx: ::core::option::Option<
super::super::super::super::txhash::v1::TransactionId,
>,
}
impl ::prost::Name for Visible {
const NAME: &'static str = "Visible";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SwapClaimView.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Opaque {
#[prost(message, optional, tag = "1")]
pub swap_claim: ::core::option::Option<super::SwapClaim>,
}
impl ::prost::Name for Opaque {
const NAME: &'static str = "Opaque";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SwapClaimView.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SwapClaimView {
#[prost(message, tag = "1")]
Visible(Visible),
#[prost(message, tag = "2")]
Opaque(Opaque),
}
}
impl ::prost::Name for SwapClaimView {
const NAME: &'static str = "SwapClaimView";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingPair {
#[prost(message, optional, tag = "1")]
pub asset_1: ::core::option::Option<super::super::super::asset::v1::AssetId>,
#[prost(message, optional, tag = "2")]
pub asset_2: ::core::option::Option<super::super::super::asset::v1::AssetId>,
}
impl ::prost::Name for TradingPair {
const NAME: &'static str = "TradingPair";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DirectedTradingPair {
#[prost(message, optional, tag = "1")]
pub start: ::core::option::Option<super::super::super::asset::v1::AssetId>,
#[prost(message, optional, tag = "2")]
pub end: ::core::option::Option<super::super::super::asset::v1::AssetId>,
}
impl ::prost::Name for DirectedTradingPair {
const NAME: &'static str = "DirectedTradingPair";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchSwapOutputData {
#[prost(message, optional, tag = "1")]
pub delta_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "2")]
pub delta_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub lambda_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub lambda_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "5")]
pub unfilled_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "6")]
pub unfilled_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(uint64, tag = "7")]
pub height: u64,
#[prost(message, optional, tag = "8")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[deprecated]
#[prost(uint64, tag = "9")]
pub epoch_starting_height: u64,
#[prost(uint64, tag = "10")]
pub sct_position_prefix: u64,
}
impl ::prost::Name for BatchSwapOutputData {
const NAME: &'static str = "BatchSwapOutputData";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingFunction {
#[prost(message, optional, tag = "1")]
pub component: ::core::option::Option<BareTradingFunction>,
#[prost(message, optional, tag = "2")]
pub pair: ::core::option::Option<TradingPair>,
}
impl ::prost::Name for TradingFunction {
const NAME: &'static str = "TradingFunction";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BareTradingFunction {
#[prost(uint32, tag = "1")]
pub fee: u32,
#[prost(message, optional, tag = "2")]
pub p: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub q: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for BareTradingFunction {
const NAME: &'static str = "BareTradingFunction";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Reserves {
#[prost(message, optional, tag = "1")]
pub r1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "2")]
pub r2: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for Reserves {
const NAME: &'static str = "Reserves";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Position {
#[prost(message, optional, tag = "1")]
pub phi: ::core::option::Option<TradingFunction>,
#[prost(bytes = "vec", tag = "2")]
pub nonce: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub state: ::core::option::Option<PositionState>,
#[prost(message, optional, tag = "4")]
pub reserves: ::core::option::Option<Reserves>,
#[prost(bool, tag = "5")]
pub close_on_fill: bool,
}
impl ::prost::Name for Position {
const NAME: &'static str = "Position";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionId {
#[prost(bytes = "vec", tag = "1")]
pub inner: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub alt_bech32m: ::prost::alloc::string::String,
}
impl ::prost::Name for PositionId {
const NAME: &'static str = "PositionId";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionState {
#[prost(enumeration = "position_state::PositionStateEnum", tag = "1")]
pub state: i32,
#[prost(uint64, tag = "2")]
pub sequence: u64,
}
pub mod position_state {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PositionStateEnum {
Unspecified = 0,
Opened = 1,
Closed = 2,
Withdrawn = 3,
Claimed = 4,
}
impl PositionStateEnum {
pub fn as_str_name(&self) -> &'static str {
match self {
PositionStateEnum::Unspecified => "POSITION_STATE_ENUM_UNSPECIFIED",
PositionStateEnum::Opened => "POSITION_STATE_ENUM_OPENED",
PositionStateEnum::Closed => "POSITION_STATE_ENUM_CLOSED",
PositionStateEnum::Withdrawn => "POSITION_STATE_ENUM_WITHDRAWN",
PositionStateEnum::Claimed => "POSITION_STATE_ENUM_CLAIMED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POSITION_STATE_ENUM_UNSPECIFIED" => Some(Self::Unspecified),
"POSITION_STATE_ENUM_OPENED" => Some(Self::Opened),
"POSITION_STATE_ENUM_CLOSED" => Some(Self::Closed),
"POSITION_STATE_ENUM_WITHDRAWN" => Some(Self::Withdrawn),
"POSITION_STATE_ENUM_CLAIMED" => Some(Self::Claimed),
_ => None,
}
}
}
}
impl ::prost::Name for PositionState {
const NAME: &'static str = "PositionState";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LpNft {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub state: ::core::option::Option<PositionState>,
}
impl ::prost::Name for LpNft {
const NAME: &'static str = "LpNft";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionOpen {
#[prost(message, optional, tag = "1")]
pub position: ::core::option::Option<Position>,
}
impl ::prost::Name for PositionOpen {
const NAME: &'static str = "PositionOpen";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionClose {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
}
impl ::prost::Name for PositionClose {
const NAME: &'static str = "PositionClose";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionWithdraw {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub reserves_commitment: ::core::option::Option<
super::super::super::asset::v1::BalanceCommitment,
>,
#[prost(uint64, tag = "3")]
pub sequence: u64,
}
impl ::prost::Name for PositionWithdraw {
const NAME: &'static str = "PositionWithdraw";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionRewardClaim {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub rewards_commitment: ::core::option::Option<
super::super::super::asset::v1::BalanceCommitment,
>,
}
impl ::prost::Name for PositionRewardClaim {
const NAME: &'static str = "PositionRewardClaim";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapExecution {
#[prost(message, repeated, tag = "1")]
pub traces: ::prost::alloc::vec::Vec<swap_execution::Trace>,
#[prost(message, optional, tag = "2")]
pub input: ::core::option::Option<super::super::super::asset::v1::Value>,
#[prost(message, optional, tag = "3")]
pub output: ::core::option::Option<super::super::super::asset::v1::Value>,
}
pub mod swap_execution {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Trace {
#[prost(message, repeated, tag = "1")]
pub value: ::prost::alloc::vec::Vec<
super::super::super::super::asset::v1::Value,
>,
}
impl ::prost::Name for Trace {
const NAME: &'static str = "Trace";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SwapExecution.{}", Self::NAME
)
}
}
}
impl ::prost::Name for SwapExecution {
const NAME: &'static str = "SwapExecution";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionWithdrawPlan {
#[prost(message, optional, tag = "1")]
pub reserves: ::core::option::Option<Reserves>,
#[prost(message, optional, tag = "2")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "3")]
pub pair: ::core::option::Option<TradingPair>,
#[prost(uint64, tag = "4")]
pub sequence: u64,
#[prost(message, repeated, tag = "5")]
pub rewards: ::prost::alloc::vec::Vec<super::super::super::asset::v1::Value>,
}
impl ::prost::Name for PositionWithdrawPlan {
const NAME: &'static str = "PositionWithdrawPlan";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionRewardClaimPlan {
#[prost(message, optional, tag = "1")]
pub reserves: ::core::option::Option<Reserves>,
}
impl ::prost::Name for PositionRewardClaimPlan {
const NAME: &'static str = "PositionRewardClaimPlan";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchSwapOutputDataRequest {
#[prost(uint64, tag = "2")]
pub height: u64,
#[prost(message, optional, tag = "3")]
pub trading_pair: ::core::option::Option<TradingPair>,
}
impl ::prost::Name for BatchSwapOutputDataRequest {
const NAME: &'static str = "BatchSwapOutputDataRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchSwapOutputDataResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<BatchSwapOutputData>,
}
impl ::prost::Name for BatchSwapOutputDataResponse {
const NAME: &'static str = "BatchSwapOutputDataResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapExecutionRequest {
#[prost(uint64, tag = "2")]
pub height: u64,
#[prost(message, optional, tag = "3")]
pub trading_pair: ::core::option::Option<DirectedTradingPair>,
}
impl ::prost::Name for SwapExecutionRequest {
const NAME: &'static str = "SwapExecutionRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapExecutionResponse {
#[prost(message, optional, tag = "1")]
pub swap_execution: ::core::option::Option<SwapExecution>,
}
impl ::prost::Name for SwapExecutionResponse {
const NAME: &'static str = "SwapExecutionResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbExecutionRequest {
#[prost(uint64, tag = "2")]
pub height: u64,
}
impl ::prost::Name for ArbExecutionRequest {
const NAME: &'static str = "ArbExecutionRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbExecutionResponse {
#[prost(message, optional, tag = "1")]
pub swap_execution: ::core::option::Option<SwapExecution>,
#[prost(uint64, tag = "2")]
pub height: u64,
}
impl ::prost::Name for ArbExecutionResponse {
const NAME: &'static str = "ArbExecutionResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapExecutionsRequest {
#[prost(uint64, tag = "2")]
pub start_height: u64,
#[prost(uint64, tag = "3")]
pub end_height: u64,
#[prost(message, optional, tag = "4")]
pub trading_pair: ::core::option::Option<DirectedTradingPair>,
}
impl ::prost::Name for SwapExecutionsRequest {
const NAME: &'static str = "SwapExecutionsRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapExecutionsResponse {
#[prost(message, optional, tag = "1")]
pub swap_execution: ::core::option::Option<SwapExecution>,
#[prost(uint64, tag = "2")]
pub height: u64,
#[prost(message, optional, tag = "3")]
pub trading_pair: ::core::option::Option<DirectedTradingPair>,
}
impl ::prost::Name for SwapExecutionsResponse {
const NAME: &'static str = "SwapExecutionsResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbExecutionsRequest {
#[prost(uint64, tag = "2")]
pub start_height: u64,
#[prost(uint64, tag = "3")]
pub end_height: u64,
}
impl ::prost::Name for ArbExecutionsRequest {
const NAME: &'static str = "ArbExecutionsRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbExecutionsResponse {
#[prost(message, optional, tag = "1")]
pub swap_execution: ::core::option::Option<SwapExecution>,
#[prost(uint64, tag = "2")]
pub height: u64,
}
impl ::prost::Name for ArbExecutionsResponse {
const NAME: &'static str = "ArbExecutionsResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsRequest {
#[prost(bool, tag = "4")]
pub include_closed: bool,
}
impl ::prost::Name for LiquidityPositionsRequest {
const NAME: &'static str = "LiquidityPositionsRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<Position>,
}
impl ::prost::Name for LiquidityPositionsResponse {
const NAME: &'static str = "LiquidityPositionsResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionByIdRequest {
#[prost(message, optional, tag = "2")]
pub position_id: ::core::option::Option<PositionId>,
}
impl ::prost::Name for LiquidityPositionByIdRequest {
const NAME: &'static str = "LiquidityPositionByIdRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionByIdResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<Position>,
}
impl ::prost::Name for LiquidityPositionByIdResponse {
const NAME: &'static str = "LiquidityPositionByIdResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsByIdRequest {
#[prost(message, repeated, tag = "2")]
pub position_id: ::prost::alloc::vec::Vec<PositionId>,
}
impl ::prost::Name for LiquidityPositionsByIdRequest {
const NAME: &'static str = "LiquidityPositionsByIdRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsByIdResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<Position>,
}
impl ::prost::Name for LiquidityPositionsByIdResponse {
const NAME: &'static str = "LiquidityPositionsByIdResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsByPriceRequest {
#[prost(message, optional, tag = "2")]
pub trading_pair: ::core::option::Option<DirectedTradingPair>,
#[prost(uint64, tag = "5")]
pub limit: u64,
}
impl ::prost::Name for LiquidityPositionsByPriceRequest {
const NAME: &'static str = "LiquidityPositionsByPriceRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiquidityPositionsByPriceResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<Position>,
#[prost(message, optional, tag = "2")]
pub id: ::core::option::Option<PositionId>,
}
impl ::prost::Name for LiquidityPositionsByPriceResponse {
const NAME: &'static str = "LiquidityPositionsByPriceResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpreadRequest {
#[prost(message, optional, tag = "2")]
pub trading_pair: ::core::option::Option<TradingPair>,
}
impl ::prost::Name for SpreadRequest {
const NAME: &'static str = "SpreadRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpreadResponse {
#[prost(message, optional, tag = "1")]
pub best_1_to_2_position: ::core::option::Option<Position>,
#[prost(message, optional, tag = "2")]
pub best_2_to_1_position: ::core::option::Option<Position>,
#[prost(double, tag = "3")]
pub approx_effective_price_1_to_2: f64,
#[prost(double, tag = "4")]
pub approx_effective_price_2_to_1: f64,
}
impl ::prost::Name for SpreadResponse {
const NAME: &'static str = "SpreadResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateTradeRequest {
#[prost(message, optional, tag = "1")]
pub input: ::core::option::Option<super::super::super::asset::v1::Value>,
#[prost(message, optional, tag = "2")]
pub output: ::core::option::Option<super::super::super::asset::v1::AssetId>,
#[prost(message, optional, tag = "3")]
pub routing: ::core::option::Option<simulate_trade_request::Routing>,
}
pub mod simulate_trade_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Routing {
#[prost(oneof = "routing::Setting", tags = "1, 2")]
pub setting: ::core::option::Option<routing::Setting>,
}
pub mod routing {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SingleHop {}
impl ::prost::Name for SingleHop {
const NAME: &'static str = "SingleHop";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SimulateTradeRequest.Routing.{}",
Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Default {}
impl ::prost::Name for Default {
const NAME: &'static str = "Default";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SimulateTradeRequest.Routing.{}",
Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Setting {
#[prost(message, tag = "1")]
Default(Default),
#[prost(message, tag = "2")]
SingleHop(SingleHop),
}
}
impl ::prost::Name for Routing {
const NAME: &'static str = "Routing";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.dex.v1.SimulateTradeRequest.{}", Self::NAME
)
}
}
}
impl ::prost::Name for SimulateTradeRequest {
const NAME: &'static str = "SimulateTradeRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateTradeResponse {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<SwapExecution>,
#[prost(message, optional, tag = "2")]
pub unfilled: ::core::option::Option<super::super::super::asset::v1::Value>,
}
impl ::prost::Name for SimulateTradeResponse {
const NAME: &'static str = "SimulateTradeResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventSwap {
#[prost(message, optional, tag = "1")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "2")]
pub delta_1_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub delta_2_i: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub swap_commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
}
impl ::prost::Name for EventSwap {
const NAME: &'static str = "EventSwap";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventSwapClaim {
#[prost(message, optional, tag = "1")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "2")]
pub output_1_commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
#[prost(message, optional, tag = "3")]
pub output_2_commitment: ::core::option::Option<
super::super::super::super::crypto::tct::v1::StateCommitment,
>,
#[prost(message, optional, tag = "4")]
pub nullifier: ::core::option::Option<super::super::sct::v1::Nullifier>,
}
impl ::prost::Name for EventSwapClaim {
const NAME: &'static str = "EventSwapClaim";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventPositionOpen {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "3")]
pub reserves_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub reserves_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(uint32, tag = "5")]
pub trading_fee: u32,
#[prost(message, optional, tag = "6")]
pub position: ::core::option::Option<Position>,
}
impl ::prost::Name for EventPositionOpen {
const NAME: &'static str = "EventPositionOpen";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventPositionClose {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
}
impl ::prost::Name for EventPositionClose {
const NAME: &'static str = "EventPositionClose";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventQueuePositionClose {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
}
impl ::prost::Name for EventQueuePositionClose {
const NAME: &'static str = "EventQueuePositionClose";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventPositionWithdraw {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "3")]
pub reserves_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub reserves_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(uint64, tag = "5")]
pub sequence: u64,
}
impl ::prost::Name for EventPositionWithdraw {
const NAME: &'static str = "EventPositionWithdraw";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventPositionExecution {
#[prost(message, optional, tag = "1")]
pub position_id: ::core::option::Option<PositionId>,
#[prost(message, optional, tag = "2")]
pub trading_pair: ::core::option::Option<TradingPair>,
#[prost(message, optional, tag = "3")]
pub reserves_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "4")]
pub reserves_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "5")]
pub prev_reserves_1: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "6")]
pub prev_reserves_2: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "7")]
pub context: ::core::option::Option<DirectedTradingPair>,
}
impl ::prost::Name for EventPositionExecution {
const NAME: &'static str = "EventPositionExecution";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventBatchSwap {
#[prost(message, optional, tag = "1")]
pub batch_swap_output_data: ::core::option::Option<BatchSwapOutputData>,
#[prost(message, optional, tag = "2")]
pub swap_execution_1_for_2: ::core::option::Option<SwapExecution>,
#[prost(message, optional, tag = "3")]
pub swap_execution_2_for_1: ::core::option::Option<SwapExecution>,
}
impl ::prost::Name for EventBatchSwap {
const NAME: &'static str = "EventBatchSwap";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventArbExecution {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(message, optional, tag = "2")]
pub swap_execution: ::core::option::Option<SwapExecution>,
}
impl ::prost::Name for EventArbExecution {
const NAME: &'static str = "EventArbExecution";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValueCircuitBreakerCredit {
#[prost(message, optional, tag = "1")]
pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
#[prost(message, optional, tag = "2")]
pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub new_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for EventValueCircuitBreakerCredit {
const NAME: &'static str = "EventValueCircuitBreakerCredit";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventValueCircuitBreakerDebit {
#[prost(message, optional, tag = "1")]
pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
#[prost(message, optional, tag = "2")]
pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
#[prost(message, optional, tag = "3")]
pub new_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
}
impl ::prost::Name for EventValueCircuitBreakerDebit {
const NAME: &'static str = "EventValueCircuitBreakerDebit";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventCandlestickData {
#[prost(message, optional, tag = "1")]
pub pair: ::core::option::Option<DirectedTradingPair>,
#[prost(message, optional, tag = "2")]
pub stick: ::core::option::Option<CandlestickData>,
}
impl ::prost::Name for EventCandlestickData {
const NAME: &'static str = "EventCandlestickData";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DexParameters {
#[prost(bool, tag = "1")]
pub is_enabled: bool,
#[prost(message, repeated, tag = "2")]
pub fixed_candidates: ::prost::alloc::vec::Vec<
super::super::super::asset::v1::AssetId,
>,
#[prost(uint32, tag = "3")]
pub max_hops: u32,
#[prost(uint32, tag = "4")]
pub max_positions_per_pair: u32,
#[prost(uint32, tag = "5")]
pub max_execution_budget: u32,
}
impl ::prost::Name for DexParameters {
const NAME: &'static str = "DexParameters";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisContent {
#[prost(message, optional, tag = "1")]
pub dex_params: ::core::option::Option<DexParameters>,
}
impl ::prost::Name for GenesisContent {
const NAME: &'static str = "GenesisContent";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandlestickData {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(double, tag = "2")]
pub open: f64,
#[prost(double, tag = "3")]
pub close: f64,
#[prost(double, tag = "4")]
pub high: f64,
#[prost(double, tag = "5")]
pub low: f64,
#[prost(double, tag = "6")]
pub direct_volume: f64,
#[prost(double, tag = "7")]
pub swap_volume: f64,
}
impl ::prost::Name for CandlestickData {
const NAME: &'static str = "CandlestickData";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandlestickDataRequest {
#[prost(message, optional, tag = "1")]
pub pair: ::core::option::Option<DirectedTradingPair>,
#[prost(uint64, tag = "2")]
pub limit: u64,
#[prost(uint64, tag = "3")]
pub start_height: u64,
}
impl ::prost::Name for CandlestickDataRequest {
const NAME: &'static str = "CandlestickDataRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandlestickDataResponse {
#[prost(message, repeated, tag = "1")]
pub data: ::prost::alloc::vec::Vec<CandlestickData>,
}
impl ::prost::Name for CandlestickDataResponse {
const NAME: &'static str = "CandlestickDataResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandlestickDataStreamRequest {
#[prost(message, optional, tag = "1")]
pub pair: ::core::option::Option<DirectedTradingPair>,
}
impl ::prost::Name for CandlestickDataStreamRequest {
const NAME: &'static str = "CandlestickDataStreamRequest";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandlestickDataStreamResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<CandlestickData>,
}
impl ::prost::Name for CandlestickDataStreamResponse {
const NAME: &'static str = "CandlestickDataStreamResponse";
const PACKAGE: &'static str = "penumbra.core.component.dex.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.dex.v1.{}", Self::NAME)
}
}
#[cfg(feature = "rpc")]
pub mod query_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QueryServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> QueryServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
QueryServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn batch_swap_output_data(
&mut self,
request: impl tonic::IntoRequest<super::BatchSwapOutputDataRequest>,
) -> std::result::Result<
tonic::Response<super::BatchSwapOutputDataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/BatchSwapOutputData",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"BatchSwapOutputData",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn swap_execution(
&mut self,
request: impl tonic::IntoRequest<super::SwapExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::SwapExecutionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/SwapExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"SwapExecution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn arb_execution(
&mut self,
request: impl tonic::IntoRequest<super::ArbExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::ArbExecutionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/ArbExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"ArbExecution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn swap_executions(
&mut self,
request: impl tonic::IntoRequest<super::SwapExecutionsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SwapExecutionsResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/SwapExecutions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"SwapExecutions",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn arb_executions(
&mut self,
request: impl tonic::IntoRequest<super::ArbExecutionsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ArbExecutionsResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/ArbExecutions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"ArbExecutions",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn liquidity_positions(
&mut self,
request: impl tonic::IntoRequest<super::LiquidityPositionsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::LiquidityPositionsResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"LiquidityPositions",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn liquidity_position_by_id(
&mut self,
request: impl tonic::IntoRequest<super::LiquidityPositionByIdRequest>,
) -> std::result::Result<
tonic::Response<super::LiquidityPositionByIdResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionById",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"LiquidityPositionById",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn liquidity_positions_by_id(
&mut self,
request: impl tonic::IntoRequest<super::LiquidityPositionsByIdRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::LiquidityPositionsByIdResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionsById",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"LiquidityPositionsById",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn liquidity_positions_by_price(
&mut self,
request: impl tonic::IntoRequest<super::LiquidityPositionsByPriceRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::LiquidityPositionsByPriceResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionsByPrice",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"LiquidityPositionsByPrice",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn spread(
&mut self,
request: impl tonic::IntoRequest<super::SpreadRequest>,
) -> std::result::Result<tonic::Response<super::SpreadResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/Spread",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"Spread",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn candlestick_data(
&mut self,
request: impl tonic::IntoRequest<super::CandlestickDataRequest>,
) -> std::result::Result<
tonic::Response<super::CandlestickDataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/CandlestickData",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"CandlestickData",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn candlestick_data_stream(
&mut self,
request: impl tonic::IntoRequest<super::CandlestickDataStreamRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::CandlestickDataStreamResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.QueryService/CandlestickDataStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.QueryService",
"CandlestickDataStream",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[cfg(feature = "rpc")]
pub mod simulation_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SimulationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SimulationServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SimulationServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> SimulationServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SimulationServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn simulate_trade(
&mut self,
request: impl tonic::IntoRequest<super::SimulateTradeRequest>,
) -> std::result::Result<
tonic::Response<super::SimulateTradeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/penumbra.core.component.dex.v1.SimulationService/SimulateTrade",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"penumbra.core.component.dex.v1.SimulationService",
"SimulateTrade",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "rpc")]
pub mod query_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait QueryService: Send + Sync + 'static {
async fn batch_swap_output_data(
&self,
request: tonic::Request<super::BatchSwapOutputDataRequest>,
) -> std::result::Result<
tonic::Response<super::BatchSwapOutputDataResponse>,
tonic::Status,
>;
async fn swap_execution(
&self,
request: tonic::Request<super::SwapExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::SwapExecutionResponse>,
tonic::Status,
>;
async fn arb_execution(
&self,
request: tonic::Request<super::ArbExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::ArbExecutionResponse>,
tonic::Status,
>;
type SwapExecutionsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::SwapExecutionsResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn swap_executions(
&self,
request: tonic::Request<super::SwapExecutionsRequest>,
) -> std::result::Result<
tonic::Response<Self::SwapExecutionsStream>,
tonic::Status,
>;
type ArbExecutionsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ArbExecutionsResponse, tonic::Status>,
>
+ Send
+ 'static;
async fn arb_executions(
&self,
request: tonic::Request<super::ArbExecutionsRequest>,
) -> std::result::Result<
tonic::Response<Self::ArbExecutionsStream>,
tonic::Status,
>;
type LiquidityPositionsStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::LiquidityPositionsResponse,
tonic::Status,
>,
>
+ Send
+ 'static;
async fn liquidity_positions(
&self,
request: tonic::Request<super::LiquidityPositionsRequest>,
) -> std::result::Result<
tonic::Response<Self::LiquidityPositionsStream>,
tonic::Status,
>;
async fn liquidity_position_by_id(
&self,
request: tonic::Request<super::LiquidityPositionByIdRequest>,
) -> std::result::Result<
tonic::Response<super::LiquidityPositionByIdResponse>,
tonic::Status,
>;
type LiquidityPositionsByIdStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::LiquidityPositionsByIdResponse,
tonic::Status,
>,
>
+ Send
+ 'static;
async fn liquidity_positions_by_id(
&self,
request: tonic::Request<super::LiquidityPositionsByIdRequest>,
) -> std::result::Result<
tonic::Response<Self::LiquidityPositionsByIdStream>,
tonic::Status,
>;
type LiquidityPositionsByPriceStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::LiquidityPositionsByPriceResponse,
tonic::Status,
>,
>
+ Send
+ 'static;
async fn liquidity_positions_by_price(
&self,
request: tonic::Request<super::LiquidityPositionsByPriceRequest>,
) -> std::result::Result<
tonic::Response<Self::LiquidityPositionsByPriceStream>,
tonic::Status,
>;
async fn spread(
&self,
request: tonic::Request<super::SpreadRequest>,
) -> std::result::Result<tonic::Response<super::SpreadResponse>, tonic::Status>;
async fn candlestick_data(
&self,
request: tonic::Request<super::CandlestickDataRequest>,
) -> std::result::Result<
tonic::Response<super::CandlestickDataResponse>,
tonic::Status,
>;
type CandlestickDataStreamStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::CandlestickDataStreamResponse,
tonic::Status,
>,
>
+ Send
+ 'static;
async fn candlestick_data_stream(
&self,
request: tonic::Request<super::CandlestickDataStreamRequest>,
) -> std::result::Result<
tonic::Response<Self::CandlestickDataStreamStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServiceServer<T: QueryService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: QueryService> QueryServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
where
T: QueryService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/penumbra.core.component.dex.v1.QueryService/BatchSwapOutputData" => {
#[allow(non_camel_case_types)]
struct BatchSwapOutputDataSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::BatchSwapOutputDataRequest>
for BatchSwapOutputDataSvc<T> {
type Response = super::BatchSwapOutputDataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::BatchSwapOutputDataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::batch_swap_output_data(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BatchSwapOutputDataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/SwapExecution" => {
#[allow(non_camel_case_types)]
struct SwapExecutionSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::SwapExecutionRequest>
for SwapExecutionSvc<T> {
type Response = super::SwapExecutionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SwapExecutionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::swap_execution(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SwapExecutionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/ArbExecution" => {
#[allow(non_camel_case_types)]
struct ArbExecutionSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::ArbExecutionRequest>
for ArbExecutionSvc<T> {
type Response = super::ArbExecutionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ArbExecutionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::arb_execution(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ArbExecutionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/SwapExecutions" => {
#[allow(non_camel_case_types)]
struct SwapExecutionsSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<super::SwapExecutionsRequest>
for SwapExecutionsSvc<T> {
type Response = super::SwapExecutionsResponse;
type ResponseStream = T::SwapExecutionsStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SwapExecutionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::swap_executions(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SwapExecutionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/ArbExecutions" => {
#[allow(non_camel_case_types)]
struct ArbExecutionsSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<super::ArbExecutionsRequest>
for ArbExecutionsSvc<T> {
type Response = super::ArbExecutionsResponse;
type ResponseStream = T::ArbExecutionsStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ArbExecutionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::arb_executions(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ArbExecutionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositions" => {
#[allow(non_camel_case_types)]
struct LiquidityPositionsSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<
super::LiquidityPositionsRequest,
> for LiquidityPositionsSvc<T> {
type Response = super::LiquidityPositionsResponse;
type ResponseStream = T::LiquidityPositionsStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::LiquidityPositionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::liquidity_positions(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LiquidityPositionsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionById" => {
#[allow(non_camel_case_types)]
struct LiquidityPositionByIdSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::LiquidityPositionByIdRequest>
for LiquidityPositionByIdSvc<T> {
type Response = super::LiquidityPositionByIdResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::LiquidityPositionByIdRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::liquidity_position_by_id(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LiquidityPositionByIdSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionsById" => {
#[allow(non_camel_case_types)]
struct LiquidityPositionsByIdSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<
super::LiquidityPositionsByIdRequest,
> for LiquidityPositionsByIdSvc<T> {
type Response = super::LiquidityPositionsByIdResponse;
type ResponseStream = T::LiquidityPositionsByIdStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::LiquidityPositionsByIdRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::liquidity_positions_by_id(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LiquidityPositionsByIdSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/LiquidityPositionsByPrice" => {
#[allow(non_camel_case_types)]
struct LiquidityPositionsByPriceSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<
super::LiquidityPositionsByPriceRequest,
> for LiquidityPositionsByPriceSvc<T> {
type Response = super::LiquidityPositionsByPriceResponse;
type ResponseStream = T::LiquidityPositionsByPriceStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::LiquidityPositionsByPriceRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::liquidity_positions_by_price(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = LiquidityPositionsByPriceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/Spread" => {
#[allow(non_camel_case_types)]
struct SpreadSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::SpreadRequest>
for SpreadSvc<T> {
type Response = super::SpreadResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SpreadRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::spread(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SpreadSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/CandlestickData" => {
#[allow(non_camel_case_types)]
struct CandlestickDataSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::UnaryService<super::CandlestickDataRequest>
for CandlestickDataSvc<T> {
type Response = super::CandlestickDataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CandlestickDataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::candlestick_data(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CandlestickDataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/penumbra.core.component.dex.v1.QueryService/CandlestickDataStream" => {
#[allow(non_camel_case_types)]
struct CandlestickDataStreamSvc<T: QueryService>(pub Arc<T>);
impl<
T: QueryService,
> tonic::server::ServerStreamingService<
super::CandlestickDataStreamRequest,
> for CandlestickDataStreamSvc<T> {
type Response = super::CandlestickDataStreamResponse;
type ResponseStream = T::CandlestickDataStreamStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CandlestickDataStreamRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as QueryService>::candlestick_data_stream(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = CandlestickDataStreamSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: QueryService> Clone for QueryServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: QueryService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: QueryService> tonic::server::NamedService for QueryServiceServer<T> {
const NAME: &'static str = "penumbra.core.component.dex.v1.QueryService";
}
}
#[cfg(feature = "rpc")]
pub mod simulation_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait SimulationService: Send + Sync + 'static {
async fn simulate_trade(
&self,
request: tonic::Request<super::SimulateTradeRequest>,
) -> std::result::Result<
tonic::Response<super::SimulateTradeResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SimulationServiceServer<T: SimulationService> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: SimulationService> SimulationServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for SimulationServiceServer<T>
where
T: SimulationService,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/penumbra.core.component.dex.v1.SimulationService/SimulateTrade" => {
#[allow(non_camel_case_types)]
struct SimulateTradeSvc<T: SimulationService>(pub Arc<T>);
impl<
T: SimulationService,
> tonic::server::UnaryService<super::SimulateTradeRequest>
for SimulateTradeSvc<T> {
type Response = super::SimulateTradeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SimulateTradeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SimulationService>::simulate_trade(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SimulateTradeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: SimulationService> Clone for SimulationServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: SimulationService> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: SimulationService> tonic::server::NamedService
for SimulationServiceServer<T> {
const NAME: &'static str = "penumbra.core.component.dex.v1.SimulationService";
}
}