gimpey_db_gateway/generated/
solana_spl_holder.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct SolanaSplHolder {
4    #[prost(string, tag = "1")]
5    pub token_address: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub holder_address: ::prost::alloc::string::String,
8    #[prost(uint64, tag = "3")]
9    pub amount: u64,
10    #[prost(bool, tag = "4")]
11    pub is_insider: bool,
12}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct UpsertRequest {
15    #[prost(string, tag = "1")]
16    pub token_address: ::prost::alloc::string::String,
17    #[prost(string, tag = "2")]
18    pub holder_address: ::prost::alloc::string::String,
19    #[prost(uint64, tag = "3")]
20    pub amount: u64,
21    #[prost(bool, optional, tag = "4")]
22    pub is_insider: ::core::option::Option<bool>,
23}
24#[derive(Clone, Copy, PartialEq, ::prost::Message)]
25pub struct UpsertResponse {
26    #[prost(bool, tag = "1")]
27    pub success: bool,
28}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct GetRequest {
31    #[prost(string, tag = "1")]
32    pub token_address: ::prost::alloc::string::String,
33    #[prost(string, tag = "2")]
34    pub holder_address: ::prost::alloc::string::String,
35}
36/// Generated client implementations.
37pub mod solana_spl_holder_service_client {
38    #![allow(
39        unused_variables,
40        dead_code,
41        missing_docs,
42        clippy::wildcard_imports,
43        clippy::let_unit_value,
44    )]
45    use tonic::codegen::*;
46    use tonic::codegen::http::Uri;
47    #[derive(Debug, Clone)]
48    pub struct SolanaSplHolderServiceClient<T> {
49        inner: tonic::client::Grpc<T>,
50    }
51    impl SolanaSplHolderServiceClient<tonic::transport::Channel> {
52        /// Attempt to create a new client by connecting to a given endpoint.
53        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
54        where
55            D: TryInto<tonic::transport::Endpoint>,
56            D::Error: Into<StdError>,
57        {
58            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
59            Ok(Self::new(conn))
60        }
61    }
62    impl<T> SolanaSplHolderServiceClient<T>
63    where
64        T: tonic::client::GrpcService<tonic::body::Body>,
65        T::Error: Into<StdError>,
66        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
67        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
68    {
69        pub fn new(inner: T) -> Self {
70            let inner = tonic::client::Grpc::new(inner);
71            Self { inner }
72        }
73        pub fn with_origin(inner: T, origin: Uri) -> Self {
74            let inner = tonic::client::Grpc::with_origin(inner, origin);
75            Self { inner }
76        }
77        pub fn with_interceptor<F>(
78            inner: T,
79            interceptor: F,
80        ) -> SolanaSplHolderServiceClient<InterceptedService<T, F>>
81        where
82            F: tonic::service::Interceptor,
83            T::ResponseBody: Default,
84            T: tonic::codegen::Service<
85                http::Request<tonic::body::Body>,
86                Response = http::Response<
87                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
88                >,
89            >,
90            <T as tonic::codegen::Service<
91                http::Request<tonic::body::Body>,
92            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
93        {
94            SolanaSplHolderServiceClient::new(
95                InterceptedService::new(inner, interceptor),
96            )
97        }
98        /// Compress requests with the given encoding.
99        ///
100        /// This requires the server to support it otherwise it might respond with an
101        /// error.
102        #[must_use]
103        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
104            self.inner = self.inner.send_compressed(encoding);
105            self
106        }
107        /// Enable decompressing responses.
108        #[must_use]
109        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
110            self.inner = self.inner.accept_compressed(encoding);
111            self
112        }
113        /// Limits the maximum size of a decoded message.
114        ///
115        /// Default: `4MB`
116        #[must_use]
117        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
118            self.inner = self.inner.max_decoding_message_size(limit);
119            self
120        }
121        /// Limits the maximum size of an encoded message.
122        ///
123        /// Default: `usize::MAX`
124        #[must_use]
125        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
126            self.inner = self.inner.max_encoding_message_size(limit);
127            self
128        }
129        pub async fn upsert(
130            &mut self,
131            request: impl tonic::IntoRequest<super::UpsertRequest>,
132        ) -> std::result::Result<tonic::Response<super::UpsertResponse>, tonic::Status> {
133            self.inner
134                .ready()
135                .await
136                .map_err(|e| {
137                    tonic::Status::unknown(
138                        format!("Service was not ready: {}", e.into()),
139                    )
140                })?;
141            let codec = tonic::codec::ProstCodec::default();
142            let path = http::uri::PathAndQuery::from_static(
143                "/solana_spl_holder.SolanaSplHolderService/Upsert",
144            );
145            let mut req = request.into_request();
146            req.extensions_mut()
147                .insert(
148                    GrpcMethod::new("solana_spl_holder.SolanaSplHolderService", "Upsert"),
149                );
150            self.inner.unary(req, path, codec).await
151        }
152        pub async fn get(
153            &mut self,
154            request: impl tonic::IntoRequest<super::GetRequest>,
155        ) -> std::result::Result<
156            tonic::Response<super::SolanaSplHolder>,
157            tonic::Status,
158        > {
159            self.inner
160                .ready()
161                .await
162                .map_err(|e| {
163                    tonic::Status::unknown(
164                        format!("Service was not ready: {}", e.into()),
165                    )
166                })?;
167            let codec = tonic::codec::ProstCodec::default();
168            let path = http::uri::PathAndQuery::from_static(
169                "/solana_spl_holder.SolanaSplHolderService/Get",
170            );
171            let mut req = request.into_request();
172            req.extensions_mut()
173                .insert(
174                    GrpcMethod::new("solana_spl_holder.SolanaSplHolderService", "Get"),
175                );
176            self.inner.unary(req, path, codec).await
177        }
178        pub async fn stream_upsert(
179            &mut self,
180            request: impl tonic::IntoStreamingRequest<Message = super::UpsertRequest>,
181        ) -> std::result::Result<tonic::Response<super::UpsertResponse>, tonic::Status> {
182            self.inner
183                .ready()
184                .await
185                .map_err(|e| {
186                    tonic::Status::unknown(
187                        format!("Service was not ready: {}", e.into()),
188                    )
189                })?;
190            let codec = tonic::codec::ProstCodec::default();
191            let path = http::uri::PathAndQuery::from_static(
192                "/solana_spl_holder.SolanaSplHolderService/StreamUpsert",
193            );
194            let mut req = request.into_streaming_request();
195            req.extensions_mut()
196                .insert(
197                    GrpcMethod::new(
198                        "solana_spl_holder.SolanaSplHolderService",
199                        "StreamUpsert",
200                    ),
201                );
202            self.inner.client_streaming(req, path, codec).await
203        }
204    }
205}