#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockId {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(bytes = "vec", tag = "2")]
pub hash: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockRange {
#[prost(message, optional, tag = "1")]
pub start: ::core::option::Option<BlockId>,
#[prost(message, optional, tag = "2")]
pub end: ::core::option::Option<BlockId>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxFilter {
#[prost(message, optional, tag = "1")]
pub block: ::core::option::Option<BlockId>,
#[prost(uint64, tag = "2")]
pub index: u64,
#[prost(bytes = "vec", tag = "3")]
pub hash: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawTransaction {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "2")]
pub height: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendResponse {
#[prost(int32, tag = "1")]
pub error_code: i32,
#[prost(string, tag = "2")]
pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainSpec {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LightdInfo {
#[prost(string, tag = "1")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vendor: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub taddr_support: bool,
#[prost(string, tag = "4")]
pub chain_name: ::prost::alloc::string::String,
#[prost(uint64, tag = "5")]
pub sapling_activation_height: u64,
#[prost(string, tag = "6")]
pub consensus_branch_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "7")]
pub block_height: u64,
#[prost(string, tag = "8")]
pub git_commit: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub branch: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub build_date: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub build_user: ::prost::alloc::string::String,
#[prost(uint64, tag = "12")]
pub estimated_height: u64,
#[prost(string, tag = "13")]
pub zcashd_build: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub zcashd_subversion: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransparentAddressBlockFilter {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<BlockRange>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Duration {
#[prost(int64, tag = "1")]
pub interval_us: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PingResponse {
#[prost(int64, tag = "1")]
pub entry: i64,
#[prost(int64, tag = "2")]
pub exit: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Address {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddressList {
#[prost(string, repeated, tag = "1")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Balance {
#[prost(int64, tag = "1")]
pub value_zat: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Exclude {
#[prost(bytes = "vec", repeated, tag = "1")]
pub txid: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TreeState {
#[prost(string, tag = "1")]
pub network: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub height: u64,
#[prost(string, tag = "3")]
pub hash: ::prost::alloc::string::String,
#[prost(uint32, tag = "4")]
pub time: u32,
#[prost(string, tag = "5")]
pub sapling_tree: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub orchard_tree: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAddressUtxosArg {
#[prost(string, repeated, tag = "1")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint64, tag = "2")]
pub start_height: u64,
#[prost(uint32, tag = "3")]
pub max_entries: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAddressUtxosReply {
#[prost(string, tag = "6")]
pub address: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "1")]
pub txid: ::prost::alloc::vec::Vec<u8>,
#[prost(int32, tag = "2")]
pub index: i32,
#[prost(bytes = "vec", tag = "3")]
pub script: ::prost::alloc::vec::Vec<u8>,
#[prost(int64, tag = "4")]
pub value_zat: i64,
#[prost(uint64, tag = "5")]
pub height: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAddressUtxosReplyList {
#[prost(message, repeated, tag = "1")]
pub address_utxos: ::prost::alloc::vec::Vec<GetAddressUtxosReply>,
}
pub mod compact_tx_streamer_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 CompactTxStreamerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CompactTxStreamerClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CompactTxStreamerClient<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,
) -> CompactTxStreamerClient<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,
{
CompactTxStreamerClient::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
}
pub async fn get_latest_block(
&mut self,
request: impl tonic::IntoRequest<super::ChainSpec>,
) -> Result<tonic::Response<super::BlockId>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_block(
&mut self,
request: impl tonic::IntoRequest<super::BlockId>,
) -> Result<
tonic::Response<crate::proto::compact_formats::CompactBlock>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_block_range(
&mut self,
request: impl tonic::IntoRequest<super::BlockRange>,
) -> Result<
tonic::Response<
tonic::codec::Streaming<crate::proto::compact_formats::CompactBlock>,
>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn get_transaction(
&mut self,
request: impl tonic::IntoRequest<super::TxFilter>,
) -> Result<tonic::Response<super::RawTransaction>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn send_transaction(
&mut self,
request: impl tonic::IntoRequest<super::RawTransaction>,
) -> Result<tonic::Response<super::SendResponse>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_taddress_txids(
&mut self,
request: impl tonic::IntoRequest<super::TransparentAddressBlockFilter>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::RawTransaction>>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressTxids",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn get_taddress_balance(
&mut self,
request: impl tonic::IntoRequest<super::AddressList>,
) -> Result<tonic::Response<super::Balance>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalance",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_taddress_balance_stream(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::Address>,
) -> Result<tonic::Response<super::Balance>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalanceStream",
);
self.inner
.client_streaming(request.into_streaming_request(), path, codec)
.await
}
pub async fn get_mempool_tx(
&mut self,
request: impl tonic::IntoRequest<super::Exclude>,
) -> Result<
tonic::Response<
tonic::codec::Streaming<crate::proto::compact_formats::CompactTx>,
>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolTx",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn get_mempool_stream(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::RawTransaction>>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolStream",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn get_tree_state(
&mut self,
request: impl tonic::IntoRequest<super::BlockId>,
) -> Result<tonic::Response<super::TreeState>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTreeState",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_latest_tree_state(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> Result<tonic::Response<super::TreeState>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestTreeState",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_address_utxos(
&mut self,
request: impl tonic::IntoRequest<super::GetAddressUtxosArg>,
) -> Result<tonic::Response<super::GetAddressUtxosReplyList>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_address_utxos_stream(
&mut self,
request: impl tonic::IntoRequest<super::GetAddressUtxosArg>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::GetAddressUtxosReply>>,
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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
pub async fn get_lightd_info(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> Result<tonic::Response<super::LightdInfo>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn ping(
&mut self,
request: impl tonic::IntoRequest<super::Duration>,
) -> Result<tonic::Response<super::PingResponse>, 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(
"/cash.z.wallet.sdk.rpc.CompactTxStreamer/Ping",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}