#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSyncStatusRequest {
#[prost(uint32, tag = "1")]
pub domain: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSyncStatusResponse {
#[prost(uint64, optional, tag = "3")]
pub last_unfinalized_block: ::core::option::Option<u64>,
#[prost(oneof = "get_sync_status_response::FinalizedTip", tags = "1, 2")]
pub finalized_tip: ::core::option::Option<get_sync_status_response::FinalizedTip>,
}
pub mod get_sync_status_response {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum FinalizedTip {
#[prost(message, tag = "1")]
Synced(super::FinalizedTipSynced),
#[prost(message, tag = "2")]
Syncing(super::FinalizedTipSyncing),
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FinalizedTipSynced {
#[prost(uint64, tag = "1")]
pub tip: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FinalizedTipSyncing {
#[prost(uint64, tag = "1")]
pub tip: u64,
#[prost(uint64, tag = "2")]
pub current: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpendRequest {
#[prost(message, optional, tag = "1")]
pub signed_spend_intent: ::core::option::Option<
super::super::types::v1::SignedSpendIntent,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpendResponse {
#[prost(oneof = "spend_response::Result", tags = "1, 2")]
pub result: ::core::option::Option<spend_response::Result>,
}
pub mod spend_response {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Accepted(super::super::super::types::v1::SpendAttestation),
#[prost(string, tag = "2")]
Rejected(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpendFeesRequest {
#[prost(message, optional, tag = "1")]
pub spend_intent: ::core::option::Option<super::super::types::v1::SpendIntent>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpendFeesResponse {
#[prost(message, optional, tag = "1")]
pub fees_breakdown: ::core::option::Option<
super::super::types::v1::SpendFeesBreakdown,
>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListDeploymentsRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TridentDeployment {
#[prost(uint32, tag = "1")]
pub domain: u32,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub finalized_block: u64,
#[prost(message, optional, tag = "4")]
pub deposit_contract: ::core::option::Option<
super::super::types::v1::MultiChainAddress,
>,
#[prost(message, optional, tag = "5")]
pub delivery_contract: ::core::option::Option<
super::super::types::v1::MultiChainAddress,
>,
#[prost(uint64, tag = "6")]
pub spend_intent_min_expiry_height: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDeploymentsResponse {
#[prost(message, repeated, tag = "1")]
pub deployments: ::prost::alloc::vec::Vec<TridentDeployment>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDomainBalanceRequest {
#[prost(uint32, tag = "1")]
pub domain: u32,
#[prost(message, optional, tag = "2")]
pub address: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(message, optional, tag = "3")]
pub token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDomainBalanceResponse {
#[prost(message, optional, tag = "1")]
pub balance: ::core::option::Option<TokenBalance>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDomainBalancesRequest {
#[prost(uint32, tag = "1")]
pub domain: u32,
#[prost(message, optional, tag = "2")]
pub address: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(uint32, tag = "3")]
pub limit: u32,
#[prost(bytes = "vec", optional, tag = "4")]
pub cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDomainBalancesResponse {
#[prost(message, repeated, tag = "1")]
pub balances: ::prost::alloc::vec::Vec<TokenBalance>,
#[prost(bytes = "vec", optional, tag = "2")]
pub next_cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TokenBalance {
#[prost(message, optional, tag = "1")]
pub token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(message, optional, tag = "2")]
pub deposited_balance: ::core::option::Option<super::super::types::v1::U256>,
#[prost(message, optional, tag = "3")]
pub available_balance: ::core::option::Option<super::super::types::v1::U256>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAttestedSpendIntentRequest {
#[prost(bytes = "vec", tag = "1")]
pub spend_spec_hash: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAttestedSpendIntentResponse {
#[prost(message, optional, tag = "1")]
pub attested_spend_intent: ::core::option::Option<
super::super::types::v1::AttestedSpendIntent,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAttestedSpendIntentsBySrcSpenderRequest {
#[prost(message, optional, tag = "1")]
pub src_spender: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(uint32, tag = "2")]
pub src_domain: u32,
#[prost(uint32, tag = "3")]
pub limit: u32,
#[prost(bytes = "vec", optional, tag = "4")]
pub cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAttestedSpendIntentsBySrcSpenderResponse {
#[prost(message, repeated, tag = "1")]
pub attested_spend_intents: ::prost::alloc::vec::Vec<
super::super::types::v1::AttestedSpendIntent,
>,
#[prost(bytes = "vec", optional, tag = "2")]
pub next_cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTokenRoutesRequest {
#[prost(uint32, tag = "1")]
pub from_domain: u32,
#[prost(message, optional, tag = "2")]
pub from_token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(uint32, tag = "3")]
pub limit: u32,
#[prost(bytes = "vec", optional, tag = "4")]
pub cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTokenRoutesResponse {
#[prost(message, repeated, tag = "1")]
pub routes: ::prost::alloc::vec::Vec<TokenRoute>,
#[prost(bytes = "vec", optional, tag = "2")]
pub next_cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TokenRoute {
#[prost(uint32, tag = "1")]
pub to_domain: u32,
#[prost(message, optional, tag = "2")]
pub to_token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDomainRoutesRequest {
#[prost(uint32, tag = "1")]
pub from_domain: u32,
#[prost(uint32, tag = "2")]
pub limit: u32,
#[prost(bytes = "vec", optional, tag = "3")]
pub cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDomainRoutesResponse {
#[prost(message, repeated, tag = "1")]
pub routes: ::prost::alloc::vec::Vec<DomainRoute>,
#[prost(bytes = "vec", optional, tag = "2")]
pub next_cursor: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DomainRoute {
#[prost(message, optional, tag = "1")]
pub from_token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
#[prost(uint32, tag = "2")]
pub to_domain: u32,
#[prost(message, optional, tag = "3")]
pub to_token: ::core::option::Option<super::super::types::v1::MultiChainAddress>,
}
pub mod delivery_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DeliveryServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> DeliveryServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DeliveryServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DeliveryServiceClient::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 spend(
&mut self,
request: impl tonic::IntoRequest<super::SpendRequest>,
) -> std::result::Result<tonic::Response<super::SpendResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/Spend",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("trident.delivery.v1.DeliveryService", "Spend"));
self.inner.unary(req, path, codec).await
}
pub async fn get_spend_fees(
&mut self,
request: impl tonic::IntoRequest<super::GetSpendFeesRequest>,
) -> std::result::Result<
tonic::Response<super::GetSpendFeesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetSpendFees",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetSpendFees",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_deployments(
&mut self,
request: impl tonic::IntoRequest<super::ListDeploymentsRequest>,
) -> std::result::Result<
tonic::Response<super::ListDeploymentsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/ListDeployments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"ListDeployments",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sync_status(
&mut self,
request: impl tonic::IntoRequest<super::GetSyncStatusRequest>,
) -> std::result::Result<
tonic::Response<super::GetSyncStatusResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetSyncStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetSyncStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_domain_balance(
&mut self,
request: impl tonic::IntoRequest<super::GetDomainBalanceRequest>,
) -> std::result::Result<
tonic::Response<super::GetDomainBalanceResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetDomainBalance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetDomainBalance",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_domain_balances(
&mut self,
request: impl tonic::IntoRequest<super::GetDomainBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::GetDomainBalancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetDomainBalances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetDomainBalances",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_attested_spend_intent(
&mut self,
request: impl tonic::IntoRequest<super::GetAttestedSpendIntentRequest>,
) -> std::result::Result<
tonic::Response<super::GetAttestedSpendIntentResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetAttestedSpendIntent",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetAttestedSpendIntent",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_attested_spend_intents_by_src_spender(
&mut self,
request: impl tonic::IntoRequest<
super::GetAttestedSpendIntentsBySrcSpenderRequest,
>,
) -> std::result::Result<
tonic::Response<super::GetAttestedSpendIntentsBySrcSpenderResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetAttestedSpendIntentsBySrcSpender",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetAttestedSpendIntentsBySrcSpender",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_token_routes(
&mut self,
request: impl tonic::IntoRequest<super::GetTokenRoutesRequest>,
) -> std::result::Result<
tonic::Response<super::GetTokenRoutesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetTokenRoutes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetTokenRoutes",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_domain_routes(
&mut self,
request: impl tonic::IntoRequest<super::GetDomainRoutesRequest>,
) -> std::result::Result<
tonic::Response<super::GetDomainRoutesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/trident.delivery.v1.DeliveryService/GetDomainRoutes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"trident.delivery.v1.DeliveryService",
"GetDomainRoutes",
),
);
self.inner.unary(req, path, codec).await
}
}
}