clementine_core/rpc/
clementine.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct Empty {}
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Txid {
6    #[prost(bytes = "vec", tag = "1")]
7    pub txid: ::prost::alloc::vec::Vec<u8>,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct Outpoint {
11    #[prost(message, optional, tag = "1")]
12    pub txid: ::core::option::Option<Txid>,
13    #[prost(uint32, tag = "2")]
14    pub vout: u32,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct Outpoints {
18    #[prost(message, repeated, tag = "1")]
19    pub outpoints: ::prost::alloc::vec::Vec<Outpoint>,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct NofnResponse {
23    #[prost(bytes = "vec", tag = "1")]
24    pub nofn_xonly_pk: ::prost::alloc::vec::Vec<u8>,
25    #[prost(uint32, tag = "2")]
26    pub num_verifiers: u32,
27}
28#[derive(Clone, Copy, PartialEq, ::prost::Message)]
29pub struct NormalSignatureId {
30    #[prost(enumeration = "NormalSignatureKind", tag = "1")]
31    pub signature_kind: i32,
32}
33#[derive(Clone, Copy, PartialEq, ::prost::Message)]
34pub struct NumberedSignatureId {
35    #[prost(enumeration = "NumberedSignatureKind", tag = "1")]
36    pub signature_kind: i32,
37    #[prost(int32, tag = "2")]
38    pub idx: i32,
39}
40/// A tagged signature struct that identifies the transaction-input that the signature is for.
41/// The id is left as NotStored for signatures that are created on the fly by the operator (they're also not stored).
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct TaggedSignature {
44    #[prost(bytes = "vec", tag = "3")]
45    pub signature: ::prost::alloc::vec::Vec<u8>,
46    #[prost(oneof = "tagged_signature::SignatureId", tags = "1, 2")]
47    pub signature_id: ::core::option::Option<tagged_signature::SignatureId>,
48}
49/// Nested message and enum types in `TaggedSignature`.
50pub mod tagged_signature {
51    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
52    pub enum SignatureId {
53        #[prost(message, tag = "1")]
54        NormalSignature(super::NormalSignatureId),
55        #[prost(message, tag = "2")]
56        NumberedSignature(super::NumberedSignatureId),
57    }
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct DepositSignatures {
61    #[prost(message, repeated, tag = "1")]
62    pub signatures: ::prost::alloc::vec::Vec<TaggedSignature>,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct ChallengeAckDigest {
66    #[prost(bytes = "vec", tag = "1")]
67    pub hash: ::prost::alloc::vec::Vec<u8>,
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct WinternitzPubkey {
71    #[prost(bytes = "vec", repeated, tag = "3")]
72    pub digit_pubkey: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
73}
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct DepositParams {
76    #[prost(message, optional, tag = "1")]
77    pub deposit: ::core::option::Option<Deposit>,
78    #[prost(message, optional, tag = "2")]
79    pub actors: ::core::option::Option<Actors>,
80    #[prost(message, optional, tag = "3")]
81    pub security_council: ::core::option::Option<SecurityCouncil>,
82}
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct SecurityCouncil {
85    #[prost(bytes = "vec", repeated, tag = "1")]
86    pub pks: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
87    #[prost(uint32, tag = "2")]
88    pub threshold: u32,
89}
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct Deposit {
92    /// / User's deposit UTXO.
93    #[prost(message, optional, tag = "1")]
94    pub deposit_outpoint: ::core::option::Option<Outpoint>,
95    #[prost(oneof = "deposit::DepositData", tags = "2, 3")]
96    pub deposit_data: ::core::option::Option<deposit::DepositData>,
97}
98/// Nested message and enum types in `Deposit`.
99pub mod deposit {
100    #[derive(Clone, PartialEq, ::prost::Oneof)]
101    pub enum DepositData {
102        #[prost(message, tag = "2")]
103        BaseDeposit(super::BaseDeposit),
104        #[prost(message, tag = "3")]
105        ReplacementDeposit(super::ReplacementDeposit),
106    }
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Actors {
110    /// / Public keys of verifiers that will participate in the deposit.
111    #[prost(message, optional, tag = "1")]
112    pub verifiers: ::core::option::Option<VerifierPublicKeys>,
113    /// / X-only public keys of watchtowers that will participate in the deposit.
114    /// / NOTE: verifiers are automatically considered watchtowers. This field is only for additional watchtowers.
115    #[prost(message, optional, tag = "2")]
116    pub watchtowers: ::core::option::Option<XOnlyPublicKeys>,
117    /// / X-only public keys of operators that will participate in the deposit.
118    #[prost(message, optional, tag = "3")]
119    pub operators: ::core::option::Option<XOnlyPublicKeys>,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct ReplacementDeposit {
123    /// Move to vault txid that is being replaced.
124    #[prost(message, optional, tag = "1")]
125    pub old_move_txid: ::core::option::Option<Txid>,
126}
127/// A new original deposit request's details.
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct BaseDeposit {
130    /// User's EVM address.
131    #[prost(bytes = "vec", tag = "1")]
132    pub evm_address: ::prost::alloc::vec::Vec<u8>,
133    /// User's recovery taproot address.
134    #[prost(string, tag = "2")]
135    pub recovery_taproot_address: ::prost::alloc::string::String,
136}
137#[derive(Clone, Copy, PartialEq, ::prost::Message)]
138pub struct NumberedTransactionId {
139    #[prost(enumeration = "NumberedTransactionType", tag = "1")]
140    pub transaction_type: i32,
141    #[prost(int32, tag = "2")]
142    pub index: i32,
143}
144#[derive(Clone, Copy, PartialEq, ::prost::Message)]
145pub struct GrpcTransactionId {
146    #[prost(oneof = "grpc_transaction_id::Id", tags = "1, 2")]
147    pub id: ::core::option::Option<grpc_transaction_id::Id>,
148}
149/// Nested message and enum types in `GrpcTransactionId`.
150pub mod grpc_transaction_id {
151    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
152    pub enum Id {
153        #[prost(enumeration = "super::NormalTransactionId", tag = "1")]
154        NormalTransaction(i32),
155        #[prost(message, tag = "2")]
156        NumberedTransaction(super::NumberedTransactionId),
157    }
158}
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct KickoffId {
161    #[prost(bytes = "vec", tag = "1")]
162    pub operator_xonly_pk: ::prost::alloc::vec::Vec<u8>,
163    #[prost(uint32, tag = "2")]
164    pub round_idx: u32,
165    #[prost(uint32, tag = "3")]
166    pub kickoff_idx: u32,
167}
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct TransactionRequest {
170    #[prost(message, optional, tag = "1")]
171    pub deposit_outpoint: ::core::option::Option<Outpoint>,
172    #[prost(message, optional, tag = "2")]
173    pub kickoff_id: ::core::option::Option<KickoffId>,
174}
175/// Includes the deposit params and the nonce gen initial responses (pubkeys and their signatures from all verifiers)
176#[derive(Clone, PartialEq, ::prost::Message)]
177pub struct DepositSignSession {
178    #[prost(message, optional, tag = "1")]
179    pub deposit_params: ::core::option::Option<DepositParams>,
180    #[prost(message, repeated, tag = "2")]
181    pub nonce_gen_first_responses: ::prost::alloc::vec::Vec<NonceGenFirstResponse>,
182}
183#[derive(Clone, PartialEq, ::prost::Message)]
184pub struct OperatorConfig {
185    #[prost(message, optional, tag = "1")]
186    pub collateral_funding_outpoint: ::core::option::Option<Outpoint>,
187    #[prost(string, tag = "2")]
188    pub xonly_pk: ::prost::alloc::string::String,
189    #[prost(string, tag = "3")]
190    pub wallet_reimburse_address: ::prost::alloc::string::String,
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct OperatorParams {
194    #[prost(oneof = "operator_params::Response", tags = "1, 2, 3")]
195    pub response: ::core::option::Option<operator_params::Response>,
196}
197/// Nested message and enum types in `OperatorParams`.
198pub mod operator_params {
199    #[derive(Clone, PartialEq, ::prost::Oneof)]
200    pub enum Response {
201        /// Operator's configuration.
202        #[prost(message, tag = "1")]
203        OperatorDetails(super::OperatorConfig),
204        /// Winternitz pubkeys for each kickoff utxo (to commit blockhash).
205        #[prost(message, tag = "2")]
206        WinternitzPubkeys(super::WinternitzPubkey),
207        /// unspent kickoff signatures
208        #[prost(message, tag = "3")]
209        UnspentKickoffSig(super::SchnorrSig),
210    }
211}
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct OperatorKeysWithDeposit {
214    #[prost(message, optional, tag = "1")]
215    pub operator_keys: ::core::option::Option<OperatorKeys>,
216    #[prost(message, optional, tag = "2")]
217    pub deposit_params: ::core::option::Option<DepositParams>,
218    #[prost(bytes = "vec", tag = "3")]
219    pub operator_xonly_pk: ::prost::alloc::vec::Vec<u8>,
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct OperatorKeys {
223    /// Winternitz pubkeys for each bitvm assert tx.
224    #[prost(message, repeated, tag = "1")]
225    pub winternitz_pubkeys: ::prost::alloc::vec::Vec<WinternitzPubkey>,
226    /// Hashes of preimages that will be used to ACK watchtower challenges.
227    #[prost(message, repeated, tag = "2")]
228    pub challenge_ack_digests: ::prost::alloc::vec::Vec<ChallengeAckDigest>,
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct SchnorrSig {
232    #[prost(bytes = "vec", tag = "1")]
233    pub schnorr_sig: ::prost::alloc::vec::Vec<u8>,
234}
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct WithdrawParams {
237    /// The ID of the withdrawal in Citrea
238    #[prost(uint32, tag = "1")]
239    pub withdrawal_id: u32,
240    /// User's \[`bitcoin::sighash::TapSighashType::SinglePlusAnyoneCanPay`\]
241    /// signature
242    #[prost(bytes = "vec", tag = "2")]
243    pub input_signature: ::prost::alloc::vec::Vec<u8>,
244    /// User's UTXO to claim the deposit
245    #[prost(message, optional, tag = "3")]
246    pub input_outpoint: ::core::option::Option<Outpoint>,
247    /// The withdrawal output's script_pubkey (user's signature is only valid for this pubkey)
248    #[prost(bytes = "vec", tag = "4")]
249    pub output_script_pubkey: ::prost::alloc::vec::Vec<u8>,
250    /// The withdrawal output's amount (user's signature is only valid for this amount)
251    #[prost(uint64, tag = "5")]
252    pub output_amount: u64,
253}
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct FinalizedPayoutParams {
256    #[prost(bytes = "vec", tag = "1")]
257    pub payout_blockhash: ::prost::alloc::vec::Vec<u8>,
258    #[prost(message, optional, tag = "2")]
259    pub deposit_outpoint: ::core::option::Option<Outpoint>,
260}
261#[derive(Clone, PartialEq, ::prost::Message)]
262pub struct XOnlyPublicKeyRpc {
263    #[prost(bytes = "vec", tag = "1")]
264    pub xonly_public_key: ::prost::alloc::vec::Vec<u8>,
265}
266#[derive(Clone, PartialEq, ::prost::Message)]
267pub struct StoppedTasks {
268    #[prost(string, repeated, tag = "1")]
269    pub stopped_tasks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
270}
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct EntityError {
273    #[prost(string, tag = "1")]
274    pub error: ::prost::alloc::string::String,
275}
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct EntityStatus {
278    #[prost(bool, tag = "1")]
279    pub automation: bool,
280    #[prost(string, optional, tag = "2")]
281    pub wallet_balance: ::core::option::Option<::prost::alloc::string::String>,
282    #[prost(uint32, optional, tag = "3")]
283    pub tx_sender_synced_height: ::core::option::Option<u32>,
284    #[prost(uint32, optional, tag = "4")]
285    pub finalized_synced_height: ::core::option::Option<u32>,
286    #[prost(uint32, optional, tag = "5")]
287    pub hcp_last_proven_height: ::core::option::Option<u32>,
288    #[prost(message, optional, tag = "6")]
289    pub stopped_tasks: ::core::option::Option<StoppedTasks>,
290    #[prost(uint32, optional, tag = "7")]
291    pub rpc_tip_height: ::core::option::Option<u32>,
292    #[prost(uint32, optional, tag = "8")]
293    pub bitcoin_syncer_synced_height: ::core::option::Option<u32>,
294    #[prost(uint32, optional, tag = "9")]
295    pub state_manager_next_height: ::core::option::Option<u32>,
296    #[prost(uint64, optional, tag = "10")]
297    pub btc_fee_rate_sat_vb: ::core::option::Option<u64>,
298}
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct EntityId {
301    #[prost(enumeration = "EntityType", tag = "1")]
302    pub kind: i32,
303    #[prost(string, tag = "2")]
304    pub id: ::prost::alloc::string::String,
305}
306#[derive(Clone, PartialEq, ::prost::Message)]
307pub struct EntityStatusWithId {
308    #[prost(message, optional, tag = "1")]
309    pub entity_id: ::core::option::Option<EntityId>,
310    #[prost(oneof = "entity_status_with_id::StatusResult", tags = "2, 3")]
311    pub status_result: ::core::option::Option<entity_status_with_id::StatusResult>,
312}
313/// Nested message and enum types in `EntityStatusWithId`.
314pub mod entity_status_with_id {
315    #[derive(Clone, PartialEq, ::prost::Oneof)]
316    pub enum StatusResult {
317        #[prost(message, tag = "2")]
318        Status(super::EntityStatus),
319        #[prost(message, tag = "3")]
320        Err(super::EntityError),
321    }
322}
323/// Parameters related to protocol configuration that can affect contract transactions, Citrea syncing, and version compatibility. This must not include sensitive information.
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct CompatibilityParamsRpc {
326    /// Protocol paramset in JSON format
327    #[prost(string, tag = "1")]
328    pub protocol_paramset: ::prost::alloc::string::String,
329    #[prost(string, tag = "2")]
330    pub security_council: ::prost::alloc::string::String,
331    #[prost(uint32, tag = "3")]
332    pub citrea_chain_id: u32,
333    #[prost(string, tag = "4")]
334    pub clementine_version: ::prost::alloc::string::String,
335    #[prost(bytes = "vec", tag = "5")]
336    pub bridge_circuit_constant: ::prost::alloc::vec::Vec<u8>,
337    #[prost(bytes = "vec", tag = "6")]
338    pub sha256_bitvm_cache: ::prost::alloc::vec::Vec<u8>,
339}
340#[derive(Clone, PartialEq, ::prost::Message)]
341pub struct EntityDataWithId {
342    #[prost(message, optional, tag = "1")]
343    pub entity_id: ::core::option::Option<EntityId>,
344    #[prost(oneof = "entity_data_with_id::DataResult", tags = "2, 3")]
345    pub data_result: ::core::option::Option<entity_data_with_id::DataResult>,
346}
347/// Nested message and enum types in `EntityDataWithId`.
348pub mod entity_data_with_id {
349    #[derive(Clone, PartialEq, ::prost::Oneof)]
350    pub enum DataResult {
351        #[prost(message, tag = "2")]
352        Data(super::CompatibilityParamsRpc),
353        #[prost(string, tag = "3")]
354        Error(::prost::alloc::string::String),
355    }
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct EntitiesCompatibilityData {
359    #[prost(message, repeated, tag = "1")]
360    pub entities_compatibility_data: ::prost::alloc::vec::Vec<EntityDataWithId>,
361}
362#[derive(Clone, PartialEq, ::prost::Message)]
363pub struct EntityStatuses {
364    #[prost(message, repeated, tag = "1")]
365    pub entity_statuses: ::prost::alloc::vec::Vec<EntityStatusWithId>,
366}
367#[derive(Clone, PartialEq, ::prost::Message)]
368pub struct VerifierParams {
369    #[prost(bytes = "vec", tag = "1")]
370    pub public_key: ::prost::alloc::vec::Vec<u8>,
371}
372#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct PartialSig {
374    #[prost(bytes = "vec", tag = "1")]
375    pub partial_sig: ::prost::alloc::vec::Vec<u8>,
376}
377#[derive(Clone, Copy, PartialEq, ::prost::Message)]
378pub struct NonceGenRequest {
379    #[prost(uint32, tag = "1")]
380    pub num_nonces: u32,
381}
382#[derive(Clone, PartialEq, ::prost::Message)]
383pub struct NonceGenFirstResponse {
384    /// ID of the nonce session (used to store nonces in verifier's memory)
385    /// The id is string representation of a u128 number
386    #[prost(string, tag = "1")]
387    pub id: ::prost::alloc::string::String,
388    /// Number of nonces to generate
389    #[prost(uint32, tag = "2")]
390    pub num_nonces: u32,
391}
392#[derive(Clone, PartialEq, ::prost::Message)]
393pub struct NonceGenResponse {
394    #[prost(oneof = "nonce_gen_response::Response", tags = "1, 2")]
395    pub response: ::core::option::Option<nonce_gen_response::Response>,
396}
397/// Nested message and enum types in `NonceGenResponse`.
398pub mod nonce_gen_response {
399    #[derive(Clone, PartialEq, ::prost::Oneof)]
400    pub enum Response {
401        #[prost(message, tag = "1")]
402        FirstResponse(super::NonceGenFirstResponse),
403        #[prost(bytes, tag = "2")]
404        PubNonce(::prost::alloc::vec::Vec<u8>),
405    }
406}
407#[derive(Clone, PartialEq, ::prost::Message)]
408pub struct OptimisticWithdrawParams {
409    #[prost(message, optional, tag = "1")]
410    pub withdrawal: ::core::option::Option<WithdrawParams>,
411    /// An ECDSA signature (of citrea/aggregator) over the withdrawal params
412    /// to authenticate the withdrawal params. This will be signed manually by citrea
413    /// after manual verification of the optimistic payout.
414    #[prost(string, optional, tag = "2")]
415    pub verification_signature: ::core::option::Option<::prost::alloc::string::String>,
416}
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct WithdrawParamsWithSig {
419    #[prost(message, optional, tag = "1")]
420    pub withdrawal: ::core::option::Option<WithdrawParams>,
421    /// An ECDSA signature (of citrea/aggregator) over the withdrawal params
422    /// to authenticate the withdrawal params. This will be signed manually by citrea
423    /// after manual verification of the optimistic payout.
424    /// This message contains same data as the one in Optimistic Payout signature, but with a different message name,
425    /// so that the same signature can't be used for both optimistic payout and normal withdrawal.
426    #[prost(string, optional, tag = "2")]
427    pub verification_signature: ::core::option::Option<::prost::alloc::string::String>,
428}
429/// Input of the aggregator's withdraw function.
430/// It contains the withdrawal params along with the verification signature that signs the withdrawal params.
431/// It also contains the operator's xonly public keys that the withdrawal request should be sent to. If the list is empty, the withdrawal will be sent to all operators.
432#[derive(Clone, PartialEq, ::prost::Message)]
433pub struct AggregatorWithdrawalInput {
434    #[prost(message, optional, tag = "1")]
435    pub withdrawal: ::core::option::Option<WithdrawParamsWithSig>,
436    #[prost(message, repeated, tag = "2")]
437    pub operator_xonly_pks: ::prost::alloc::vec::Vec<XOnlyPublicKeyRpc>,
438}
439#[derive(Clone, PartialEq, ::prost::Message)]
440pub struct OptimisticPayoutParams {
441    #[prost(message, optional, tag = "1")]
442    pub opt_withdrawal: ::core::option::Option<OptimisticWithdrawParams>,
443    #[prost(message, optional, tag = "2")]
444    pub nonce_gen: ::core::option::Option<NonceGenFirstResponse>,
445    #[prost(bytes = "vec", tag = "3")]
446    pub agg_nonce: ::prost::alloc::vec::Vec<u8>,
447}
448#[derive(Clone, PartialEq, ::prost::Message)]
449pub struct VerifierDepositSignParams {
450    #[prost(oneof = "verifier_deposit_sign_params::Params", tags = "1, 2")]
451    pub params: ::core::option::Option<verifier_deposit_sign_params::Params>,
452}
453/// Nested message and enum types in `VerifierDepositSignParams`.
454pub mod verifier_deposit_sign_params {
455    #[derive(Clone, PartialEq, ::prost::Oneof)]
456    pub enum Params {
457        #[prost(message, tag = "1")]
458        DepositSignFirstParam(super::DepositSignSession),
459        #[prost(bytes, tag = "2")]
460        AggNonce(::prost::alloc::vec::Vec<u8>),
461    }
462}
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct VerifierDepositFinalizeParams {
465    #[prost(oneof = "verifier_deposit_finalize_params::Params", tags = "1, 2, 3, 4")]
466    pub params: ::core::option::Option<verifier_deposit_finalize_params::Params>,
467}
468/// Nested message and enum types in `VerifierDepositFinalizeParams`.
469pub mod verifier_deposit_finalize_params {
470    #[derive(Clone, PartialEq, ::prost::Oneof)]
471    pub enum Params {
472        #[prost(message, tag = "1")]
473        DepositSignFirstParam(super::DepositSignSession),
474        #[prost(bytes, tag = "2")]
475        SchnorrSig(::prost::alloc::vec::Vec<u8>),
476        #[prost(bytes, tag = "3")]
477        MoveTxAggNonce(::prost::alloc::vec::Vec<u8>),
478        #[prost(bytes, tag = "4")]
479        EmergencyStopAggNonce(::prost::alloc::vec::Vec<u8>),
480    }
481}
482#[derive(Clone, PartialEq, ::prost::Message)]
483pub struct VerifierDepositFinalizeResponse {
484    #[prost(bytes = "vec", tag = "1")]
485    pub move_to_vault_partial_sig: ::prost::alloc::vec::Vec<u8>,
486    #[prost(bytes = "vec", tag = "2")]
487    pub emergency_stop_partial_sig: ::prost::alloc::vec::Vec<u8>,
488}
489#[derive(Clone, PartialEq, ::prost::Message)]
490pub struct VerifierPublicKeys {
491    #[prost(bytes = "vec", repeated, tag = "1")]
492    pub verifier_public_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
493}
494#[derive(Clone, Copy, PartialEq, ::prost::Message)]
495pub struct TxDebugRequest {
496    #[prost(uint32, tag = "1")]
497    pub tx_id: u32,
498}
499#[derive(Clone, PartialEq, ::prost::Message)]
500pub struct TxDebugSubmissionError {
501    #[prost(string, tag = "1")]
502    pub error_message: ::prost::alloc::string::String,
503    #[prost(string, tag = "2")]
504    pub timestamp: ::prost::alloc::string::String,
505}
506#[derive(Clone, PartialEq, ::prost::Message)]
507pub struct TxDebugFeePayerUtxo {
508    #[prost(message, optional, tag = "1")]
509    pub txid: ::core::option::Option<Txid>,
510    #[prost(uint32, tag = "2")]
511    pub vout: u32,
512    #[prost(uint64, tag = "3")]
513    pub amount: u64,
514    #[prost(bool, tag = "4")]
515    pub confirmed: bool,
516}
517#[derive(Clone, PartialEq, ::prost::Message)]
518pub struct TxMetadata {
519    /// Optional outpoint of the deposit transaction
520    #[prost(message, optional, tag = "1")]
521    pub deposit_outpoint: ::core::option::Option<Outpoint>,
522    /// Deposit identification
523    #[prost(message, optional, tag = "2")]
524    pub operator_xonly_pk: ::core::option::Option<XOnlyPublicKeyRpc>,
525    #[prost(uint32, tag = "4")]
526    pub round_idx: u32,
527    #[prost(uint32, tag = "5")]
528    pub kickoff_idx: u32,
529    /// Transaction ID
530    #[prost(message, optional, tag = "6")]
531    pub tx_type: ::core::option::Option<GrpcTransactionId>,
532}
533#[derive(Clone, PartialEq, ::prost::Message)]
534pub struct TxDebugInfo {
535    #[prost(uint32, tag = "1")]
536    pub id: u32,
537    #[prost(bool, tag = "2")]
538    pub is_active: bool,
539    #[prost(string, tag = "3")]
540    pub current_state: ::prost::alloc::string::String,
541    #[prost(message, repeated, tag = "4")]
542    pub submission_errors: ::prost::alloc::vec::Vec<TxDebugSubmissionError>,
543    #[prost(message, repeated, tag = "5")]
544    pub fee_payer_utxos: ::prost::alloc::vec::Vec<TxDebugFeePayerUtxo>,
545    #[prost(string, tag = "6")]
546    pub created_at: ::prost::alloc::string::String,
547    #[prost(message, optional, tag = "7")]
548    pub txid: ::core::option::Option<Txid>,
549    #[prost(string, tag = "8")]
550    pub fee_paying_type: ::prost::alloc::string::String,
551    #[prost(uint32, tag = "9")]
552    pub fee_payer_utxos_count: u32,
553    #[prost(uint32, tag = "10")]
554    pub fee_payer_utxos_confirmed_count: u32,
555    #[prost(bytes = "vec", tag = "11")]
556    pub raw_tx: ::prost::alloc::vec::Vec<u8>,
557    #[prost(message, optional, tag = "12")]
558    pub metadata: ::core::option::Option<TxMetadata>,
559}
560#[derive(Clone, PartialEq, ::prost::Message)]
561pub struct XOnlyPublicKeys {
562    #[prost(bytes = "vec", repeated, tag = "1")]
563    pub xonly_public_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
564}
565#[derive(Clone, PartialEq, ::prost::Message)]
566pub struct VergenResponse {
567    #[prost(string, tag = "1")]
568    pub response: ::prost::alloc::string::String,
569}
570#[derive(Clone, PartialEq, ::prost::Message)]
571pub struct RawSignedTx {
572    #[prost(bytes = "vec", tag = "1")]
573    pub raw_tx: ::prost::alloc::vec::Vec<u8>,
574}
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct SendTxRequest {
577    #[prost(message, optional, tag = "1")]
578    pub raw_tx: ::core::option::Option<RawSignedTx>,
579    #[prost(enumeration = "FeeType", tag = "2")]
580    pub fee_type: i32,
581}
582#[derive(Clone, PartialEq, ::prost::Message)]
583pub struct RawSignedTxs {
584    #[prost(message, repeated, tag = "1")]
585    pub raw_txs: ::prost::alloc::vec::Vec<RawSignedTx>,
586}
587#[derive(Clone, PartialEq, ::prost::Message)]
588pub struct SignedTxWithType {
589    #[prost(message, optional, tag = "1")]
590    pub transaction_type: ::core::option::Option<GrpcTransactionId>,
591    #[prost(bytes = "vec", tag = "2")]
592    pub raw_tx: ::prost::alloc::vec::Vec<u8>,
593}
594#[derive(Clone, PartialEq, ::prost::Message)]
595pub struct SignedTxsWithType {
596    #[prost(message, repeated, tag = "1")]
597    pub signed_txs: ::prost::alloc::vec::Vec<SignedTxWithType>,
598}
599#[derive(Clone, PartialEq, ::prost::Message)]
600pub struct RbfSigningInfoRpc {
601    #[prost(bytes = "vec", tag = "1")]
602    pub merkle_root: ::prost::alloc::vec::Vec<u8>,
603    #[prost(uint32, tag = "2")]
604    pub vout: u32,
605}
606#[derive(Clone, PartialEq, ::prost::Message)]
607pub struct RawTxWithRbfInfo {
608    #[prost(bytes = "vec", tag = "1")]
609    pub raw_tx: ::prost::alloc::vec::Vec<u8>,
610    #[prost(message, optional, tag = "2")]
611    pub rbf_info: ::core::option::Option<RbfSigningInfoRpc>,
612}
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct OperatorWithrawalResponse {
615    #[prost(message, optional, tag = "1")]
616    pub operator_xonly_pk: ::core::option::Option<XOnlyPublicKeyRpc>,
617    #[prost(oneof = "operator_withrawal_response::Response", tags = "2, 3")]
618    pub response: ::core::option::Option<operator_withrawal_response::Response>,
619}
620/// Nested message and enum types in `OperatorWithrawalResponse`.
621pub mod operator_withrawal_response {
622    #[derive(Clone, PartialEq, ::prost::Oneof)]
623    pub enum Response {
624        #[prost(message, tag = "2")]
625        RawTx(super::RawSignedTx),
626        #[prost(string, tag = "3")]
627        Error(::prost::alloc::string::String),
628    }
629}
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct AggregatorWithdrawResponse {
632    #[prost(message, repeated, tag = "1")]
633    pub withdraw_responses: ::prost::alloc::vec::Vec<OperatorWithrawalResponse>,
634}
635#[derive(Clone, PartialEq, ::prost::Message)]
636pub struct GetEmergencyStopTxRequest {
637    #[prost(message, repeated, tag = "1")]
638    pub txids: ::prost::alloc::vec::Vec<Txid>,
639}
640#[derive(Clone, PartialEq, ::prost::Message)]
641pub struct GetEmergencyStopTxResponse {
642    #[prost(message, repeated, tag = "1")]
643    pub txids: ::prost::alloc::vec::Vec<Txid>,
644    #[prost(bytes = "vec", repeated, tag = "2")]
645    pub encrypted_emergency_stop_txs: ::prost::alloc::vec::Vec<
646        ::prost::alloc::vec::Vec<u8>,
647    >,
648}
649#[derive(Clone, PartialEq, ::prost::Message)]
650pub struct SendMoveTxRequest {
651    #[prost(message, optional, tag = "1")]
652    pub raw_tx: ::core::option::Option<RawSignedTx>,
653    #[prost(message, optional, tag = "2")]
654    pub deposit_outpoint: ::core::option::Option<Outpoint>,
655}
656#[derive(Clone, Copy, PartialEq, ::prost::Message)]
657pub struct GetEntityStatusesRequest {
658    #[prost(bool, tag = "1")]
659    pub restart_tasks: bool,
660}
661#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
662#[repr(i32)]
663pub enum NormalSignatureKind {
664    NormalSignatureUnknown = 0,
665    /// Used for TxHandlers that verifiers don't care. These will have signatures created
666    /// by the operator on the fly.
667    OperatorSighashDefault = 1,
668    Challenge = 2,
669    DisproveTimeout2 = 3,
670    Disprove2 = 4,
671    Reimburse1 = 5,
672    KickoffNotFinalized1 = 6,
673    KickoffNotFinalized2 = 7,
674    Reimburse2 = 8,
675    NoSignature = 9,
676    ChallengeTimeout2 = 10,
677    MiniAssert1 = 11,
678    OperatorChallengeAck1 = 12,
679    NotStored = 13,
680    YieldKickoffTxid = 14,
681    LatestBlockhashTimeout1 = 15,
682    LatestBlockhashTimeout2 = 16,
683    LatestBlockhashTimeout3 = 17,
684    LatestBlockhash = 18,
685}
686impl NormalSignatureKind {
687    /// String value of the enum field names used in the ProtoBuf definition.
688    ///
689    /// The values are not transformed in any way and thus are considered stable
690    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
691    pub fn as_str_name(&self) -> &'static str {
692        match self {
693            Self::NormalSignatureUnknown => "NormalSignatureUnknown",
694            Self::OperatorSighashDefault => "OperatorSighashDefault",
695            Self::Challenge => "Challenge",
696            Self::DisproveTimeout2 => "DisproveTimeout2",
697            Self::Disprove2 => "Disprove2",
698            Self::Reimburse1 => "Reimburse1",
699            Self::KickoffNotFinalized1 => "KickoffNotFinalized1",
700            Self::KickoffNotFinalized2 => "KickoffNotFinalized2",
701            Self::Reimburse2 => "Reimburse2",
702            Self::NoSignature => "NoSignature",
703            Self::ChallengeTimeout2 => "ChallengeTimeout2",
704            Self::MiniAssert1 => "MiniAssert1",
705            Self::OperatorChallengeAck1 => "OperatorChallengeAck1",
706            Self::NotStored => "NotStored",
707            Self::YieldKickoffTxid => "YieldKickoffTxid",
708            Self::LatestBlockhashTimeout1 => "LatestBlockhashTimeout1",
709            Self::LatestBlockhashTimeout2 => "LatestBlockhashTimeout2",
710            Self::LatestBlockhashTimeout3 => "LatestBlockhashTimeout3",
711            Self::LatestBlockhash => "LatestBlockhash",
712        }
713    }
714    /// Creates an enum from field names used in the ProtoBuf definition.
715    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
716        match value {
717            "NormalSignatureUnknown" => Some(Self::NormalSignatureUnknown),
718            "OperatorSighashDefault" => Some(Self::OperatorSighashDefault),
719            "Challenge" => Some(Self::Challenge),
720            "DisproveTimeout2" => Some(Self::DisproveTimeout2),
721            "Disprove2" => Some(Self::Disprove2),
722            "Reimburse1" => Some(Self::Reimburse1),
723            "KickoffNotFinalized1" => Some(Self::KickoffNotFinalized1),
724            "KickoffNotFinalized2" => Some(Self::KickoffNotFinalized2),
725            "Reimburse2" => Some(Self::Reimburse2),
726            "NoSignature" => Some(Self::NoSignature),
727            "ChallengeTimeout2" => Some(Self::ChallengeTimeout2),
728            "MiniAssert1" => Some(Self::MiniAssert1),
729            "OperatorChallengeAck1" => Some(Self::OperatorChallengeAck1),
730            "NotStored" => Some(Self::NotStored),
731            "YieldKickoffTxid" => Some(Self::YieldKickoffTxid),
732            "LatestBlockhashTimeout1" => Some(Self::LatestBlockhashTimeout1),
733            "LatestBlockhashTimeout2" => Some(Self::LatestBlockhashTimeout2),
734            "LatestBlockhashTimeout3" => Some(Self::LatestBlockhashTimeout3),
735            "LatestBlockhash" => Some(Self::LatestBlockhash),
736            _ => None,
737        }
738    }
739}
740/// Signatures that are needed multiple times per an operators kickoff.
741/// Some watchtower sigs are needed once per watchtower.
742/// Asserts are needed multiple times
743#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
744#[repr(i32)]
745pub enum NumberedSignatureKind {
746    NumberedSignatureUnknown = 0,
747    /// Used for TxHandlers that verifiers don't care. These will have signatures created
748    /// by the operator on the fly.
749    NumberedNotStored = 1,
750    OperatorChallengeNack1 = 2,
751    OperatorChallengeNack2 = 3,
752    OperatorChallengeNack3 = 4,
753    AssertTimeout1 = 5,
754    AssertTimeout2 = 6,
755    AssertTimeout3 = 7,
756    UnspentKickoff1 = 8,
757    UnspentKickoff2 = 9,
758    WatchtowerChallengeTimeout1 = 10,
759    WatchtowerChallengeTimeout2 = 11,
760    WatchtowerChallenge = 12,
761}
762impl NumberedSignatureKind {
763    /// String value of the enum field names used in the ProtoBuf definition.
764    ///
765    /// The values are not transformed in any way and thus are considered stable
766    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
767    pub fn as_str_name(&self) -> &'static str {
768        match self {
769            Self::NumberedSignatureUnknown => "NumberedSignatureUnknown",
770            Self::NumberedNotStored => "NumberedNotStored",
771            Self::OperatorChallengeNack1 => "OperatorChallengeNack1",
772            Self::OperatorChallengeNack2 => "OperatorChallengeNack2",
773            Self::OperatorChallengeNack3 => "OperatorChallengeNack3",
774            Self::AssertTimeout1 => "AssertTimeout1",
775            Self::AssertTimeout2 => "AssertTimeout2",
776            Self::AssertTimeout3 => "AssertTimeout3",
777            Self::UnspentKickoff1 => "UnspentKickoff1",
778            Self::UnspentKickoff2 => "UnspentKickoff2",
779            Self::WatchtowerChallengeTimeout1 => "WatchtowerChallengeTimeout1",
780            Self::WatchtowerChallengeTimeout2 => "WatchtowerChallengeTimeout2",
781            Self::WatchtowerChallenge => "WatchtowerChallenge",
782        }
783    }
784    /// Creates an enum from field names used in the ProtoBuf definition.
785    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
786        match value {
787            "NumberedSignatureUnknown" => Some(Self::NumberedSignatureUnknown),
788            "NumberedNotStored" => Some(Self::NumberedNotStored),
789            "OperatorChallengeNack1" => Some(Self::OperatorChallengeNack1),
790            "OperatorChallengeNack2" => Some(Self::OperatorChallengeNack2),
791            "OperatorChallengeNack3" => Some(Self::OperatorChallengeNack3),
792            "AssertTimeout1" => Some(Self::AssertTimeout1),
793            "AssertTimeout2" => Some(Self::AssertTimeout2),
794            "AssertTimeout3" => Some(Self::AssertTimeout3),
795            "UnspentKickoff1" => Some(Self::UnspentKickoff1),
796            "UnspentKickoff2" => Some(Self::UnspentKickoff2),
797            "WatchtowerChallengeTimeout1" => Some(Self::WatchtowerChallengeTimeout1),
798            "WatchtowerChallengeTimeout2" => Some(Self::WatchtowerChallengeTimeout2),
799            "WatchtowerChallenge" => Some(Self::WatchtowerChallenge),
800            _ => None,
801        }
802    }
803}
804#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
805#[repr(i32)]
806pub enum FeeType {
807    Unspecified = 0,
808    Cpfp = 1,
809    Rbf = 2,
810    NoFunding = 3,
811}
812impl FeeType {
813    /// String value of the enum field names used in the ProtoBuf definition.
814    ///
815    /// The values are not transformed in any way and thus are considered stable
816    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
817    pub fn as_str_name(&self) -> &'static str {
818        match self {
819            Self::Unspecified => "UNSPECIFIED",
820            Self::Cpfp => "CPFP",
821            Self::Rbf => "RBF",
822            Self::NoFunding => "NO_FUNDING",
823        }
824    }
825    /// Creates an enum from field names used in the ProtoBuf definition.
826    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
827        match value {
828            "UNSPECIFIED" => Some(Self::Unspecified),
829            "CPFP" => Some(Self::Cpfp),
830            "RBF" => Some(Self::Rbf),
831            "NO_FUNDING" => Some(Self::NoFunding),
832            _ => None,
833        }
834    }
835}
836#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
837#[repr(i32)]
838pub enum NormalTransactionId {
839    UnspecifiedTransactionType = 0,
840    Round = 1,
841    Kickoff = 2,
842    MoveToVault = 3,
843    Payout = 4,
844    Challenge = 5,
845    Disprove = 6,
846    DisproveTimeout = 7,
847    Reimburse = 8,
848    AllNeededForDeposit = 9,
849    Dummy = 10,
850    ReadyToReimburse = 11,
851    KickoffNotFinalized = 12,
852    ChallengeTimeout = 13,
853    BurnUnusedKickoffConnectors = 14,
854    YieldKickoffTxid = 15,
855    ReplacementDeposit = 17,
856    LatestBlockhashTimeout = 18,
857    LatestBlockhash = 19,
858    OptimisticPayout = 20,
859}
860impl NormalTransactionId {
861    /// String value of the enum field names used in the ProtoBuf definition.
862    ///
863    /// The values are not transformed in any way and thus are considered stable
864    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
865    pub fn as_str_name(&self) -> &'static str {
866        match self {
867            Self::UnspecifiedTransactionType => "UNSPECIFIED_TRANSACTION_TYPE",
868            Self::Round => "ROUND",
869            Self::Kickoff => "KICKOFF",
870            Self::MoveToVault => "MOVE_TO_VAULT",
871            Self::Payout => "PAYOUT",
872            Self::Challenge => "CHALLENGE",
873            Self::Disprove => "DISPROVE",
874            Self::DisproveTimeout => "DISPROVE_TIMEOUT",
875            Self::Reimburse => "REIMBURSE",
876            Self::AllNeededForDeposit => "ALL_NEEDED_FOR_DEPOSIT",
877            Self::Dummy => "DUMMY",
878            Self::ReadyToReimburse => "READY_TO_REIMBURSE",
879            Self::KickoffNotFinalized => "KICKOFF_NOT_FINALIZED",
880            Self::ChallengeTimeout => "CHALLENGE_TIMEOUT",
881            Self::BurnUnusedKickoffConnectors => "BURN_UNUSED_KICKOFF_CONNECTORS",
882            Self::YieldKickoffTxid => "YIELD_KICKOFF_TXID",
883            Self::ReplacementDeposit => "REPLACEMENT_DEPOSIT",
884            Self::LatestBlockhashTimeout => "LATEST_BLOCKHASH_TIMEOUT",
885            Self::LatestBlockhash => "LATEST_BLOCKHASH",
886            Self::OptimisticPayout => "OPTIMISTIC_PAYOUT",
887        }
888    }
889    /// Creates an enum from field names used in the ProtoBuf definition.
890    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
891        match value {
892            "UNSPECIFIED_TRANSACTION_TYPE" => Some(Self::UnspecifiedTransactionType),
893            "ROUND" => Some(Self::Round),
894            "KICKOFF" => Some(Self::Kickoff),
895            "MOVE_TO_VAULT" => Some(Self::MoveToVault),
896            "PAYOUT" => Some(Self::Payout),
897            "CHALLENGE" => Some(Self::Challenge),
898            "DISPROVE" => Some(Self::Disprove),
899            "DISPROVE_TIMEOUT" => Some(Self::DisproveTimeout),
900            "REIMBURSE" => Some(Self::Reimburse),
901            "ALL_NEEDED_FOR_DEPOSIT" => Some(Self::AllNeededForDeposit),
902            "DUMMY" => Some(Self::Dummy),
903            "READY_TO_REIMBURSE" => Some(Self::ReadyToReimburse),
904            "KICKOFF_NOT_FINALIZED" => Some(Self::KickoffNotFinalized),
905            "CHALLENGE_TIMEOUT" => Some(Self::ChallengeTimeout),
906            "BURN_UNUSED_KICKOFF_CONNECTORS" => Some(Self::BurnUnusedKickoffConnectors),
907            "YIELD_KICKOFF_TXID" => Some(Self::YieldKickoffTxid),
908            "REPLACEMENT_DEPOSIT" => Some(Self::ReplacementDeposit),
909            "LATEST_BLOCKHASH_TIMEOUT" => Some(Self::LatestBlockhashTimeout),
910            "LATEST_BLOCKHASH" => Some(Self::LatestBlockhash),
911            "OPTIMISTIC_PAYOUT" => Some(Self::OptimisticPayout),
912            _ => None,
913        }
914    }
915}
916#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
917#[repr(i32)]
918pub enum NumberedTransactionType {
919    UnspecifiedIndexedTransactionType = 0,
920    WatchtowerChallenge = 1,
921    OperatorChallengeNack = 2,
922    OperatorChallengeAck = 3,
923    AssertTimeout = 4,
924    UnspentKickoff = 5,
925    MiniAssert = 6,
926    WatchtowerChallengeTimeout = 7,
927}
928impl NumberedTransactionType {
929    /// String value of the enum field names used in the ProtoBuf definition.
930    ///
931    /// The values are not transformed in any way and thus are considered stable
932    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
933    pub fn as_str_name(&self) -> &'static str {
934        match self {
935            Self::UnspecifiedIndexedTransactionType => {
936                "UNSPECIFIED_INDEXED_TRANSACTION_TYPE"
937            }
938            Self::WatchtowerChallenge => "WATCHTOWER_CHALLENGE",
939            Self::OperatorChallengeNack => "OPERATOR_CHALLENGE_NACK",
940            Self::OperatorChallengeAck => "OPERATOR_CHALLENGE_ACK",
941            Self::AssertTimeout => "ASSERT_TIMEOUT",
942            Self::UnspentKickoff => "UNSPENT_KICKOFF",
943            Self::MiniAssert => "MINI_ASSERT",
944            Self::WatchtowerChallengeTimeout => "WATCHTOWER_CHALLENGE_TIMEOUT",
945        }
946    }
947    /// Creates an enum from field names used in the ProtoBuf definition.
948    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
949        match value {
950            "UNSPECIFIED_INDEXED_TRANSACTION_TYPE" => {
951                Some(Self::UnspecifiedIndexedTransactionType)
952            }
953            "WATCHTOWER_CHALLENGE" => Some(Self::WatchtowerChallenge),
954            "OPERATOR_CHALLENGE_NACK" => Some(Self::OperatorChallengeNack),
955            "OPERATOR_CHALLENGE_ACK" => Some(Self::OperatorChallengeAck),
956            "ASSERT_TIMEOUT" => Some(Self::AssertTimeout),
957            "UNSPENT_KICKOFF" => Some(Self::UnspentKickoff),
958            "MINI_ASSERT" => Some(Self::MiniAssert),
959            "WATCHTOWER_CHALLENGE_TIMEOUT" => Some(Self::WatchtowerChallengeTimeout),
960            _ => None,
961        }
962    }
963}
964#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
965#[repr(i32)]
966pub enum EntityType {
967    EntityUnknown = 0,
968    Operator = 1,
969    Verifier = 2,
970    Aggregator = 3,
971}
972impl EntityType {
973    /// String value of the enum field names used in the ProtoBuf definition.
974    ///
975    /// The values are not transformed in any way and thus are considered stable
976    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
977    pub fn as_str_name(&self) -> &'static str {
978        match self {
979            Self::EntityUnknown => "ENTITY_UNKNOWN",
980            Self::Operator => "OPERATOR",
981            Self::Verifier => "VERIFIER",
982            Self::Aggregator => "AGGREGATOR",
983        }
984    }
985    /// Creates an enum from field names used in the ProtoBuf definition.
986    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
987        match value {
988            "ENTITY_UNKNOWN" => Some(Self::EntityUnknown),
989            "OPERATOR" => Some(Self::Operator),
990            "VERIFIER" => Some(Self::Verifier),
991            "AGGREGATOR" => Some(Self::Aggregator),
992            _ => None,
993        }
994    }
995}
996/// Generated client implementations.
997pub mod clementine_operator_client {
998    #![allow(
999        unused_variables,
1000        dead_code,
1001        missing_docs,
1002        clippy::wildcard_imports,
1003        clippy::let_unit_value,
1004    )]
1005    use tonic::codegen::*;
1006    use tonic::codegen::http::Uri;
1007    /// An operator is responsible for paying withdrawals. It has an unique ID and
1008    /// chain of UTXOs named `round_txs`. An operator also runs a verifier. These are
1009    /// connected to the same database and both have access to watchtowers'
1010    /// winternitz pubkeys.
1011    #[derive(Debug, Clone)]
1012    pub struct ClementineOperatorClient<T> {
1013        inner: tonic::client::Grpc<T>,
1014    }
1015    impl ClementineOperatorClient<tonic::transport::Channel> {
1016        /// Attempt to create a new client by connecting to a given endpoint.
1017        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1018        where
1019            D: TryInto<tonic::transport::Endpoint>,
1020            D::Error: Into<StdError>,
1021        {
1022            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1023            Ok(Self::new(conn))
1024        }
1025    }
1026    impl<T> ClementineOperatorClient<T>
1027    where
1028        T: tonic::client::GrpcService<tonic::body::BoxBody>,
1029        T::Error: Into<StdError>,
1030        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1031        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1032    {
1033        pub fn new(inner: T) -> Self {
1034            let inner = tonic::client::Grpc::new(inner);
1035            Self { inner }
1036        }
1037        pub fn with_origin(inner: T, origin: Uri) -> Self {
1038            let inner = tonic::client::Grpc::with_origin(inner, origin);
1039            Self { inner }
1040        }
1041        pub fn with_interceptor<F>(
1042            inner: T,
1043            interceptor: F,
1044        ) -> ClementineOperatorClient<InterceptedService<T, F>>
1045        where
1046            F: tonic::service::Interceptor,
1047            T::ResponseBody: Default,
1048            T: tonic::codegen::Service<
1049                http::Request<tonic::body::BoxBody>,
1050                Response = http::Response<
1051                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1052                >,
1053            >,
1054            <T as tonic::codegen::Service<
1055                http::Request<tonic::body::BoxBody>,
1056            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1057        {
1058            ClementineOperatorClient::new(InterceptedService::new(inner, interceptor))
1059        }
1060        /// Compress requests with the given encoding.
1061        ///
1062        /// This requires the server to support it otherwise it might respond with an
1063        /// error.
1064        #[must_use]
1065        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1066            self.inner = self.inner.send_compressed(encoding);
1067            self
1068        }
1069        /// Enable decompressing responses.
1070        #[must_use]
1071        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1072            self.inner = self.inner.accept_compressed(encoding);
1073            self
1074        }
1075        /// Limits the maximum size of a decoded message.
1076        ///
1077        /// Default: `4MB`
1078        #[must_use]
1079        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1080            self.inner = self.inner.max_decoding_message_size(limit);
1081            self
1082        }
1083        /// Limits the maximum size of an encoded message.
1084        ///
1085        /// Default: `usize::MAX`
1086        #[must_use]
1087        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1088            self.inner = self.inner.max_encoding_message_size(limit);
1089            self
1090        }
1091        /// Returns the operator's xonly public key
1092        ///
1093        /// Used by aggregator inside setup
1094        pub async fn get_x_only_public_key(
1095            &mut self,
1096            request: impl tonic::IntoRequest<super::Empty>,
1097        ) -> std::result::Result<
1098            tonic::Response<super::XOnlyPublicKeyRpc>,
1099            tonic::Status,
1100        > {
1101            self.inner
1102                .ready()
1103                .await
1104                .map_err(|e| {
1105                    tonic::Status::unknown(
1106                        format!("Service was not ready: {}", e.into()),
1107                    )
1108                })?;
1109            let codec = tonic::codec::ProstCodec::default();
1110            let path = http::uri::PathAndQuery::from_static(
1111                "/clementine.ClementineOperator/GetXOnlyPublicKey",
1112            );
1113            let mut req = request.into_request();
1114            req.extensions_mut()
1115                .insert(
1116                    GrpcMethod::new("clementine.ClementineOperator", "GetXOnlyPublicKey"),
1117                );
1118            self.inner.unary(req, path, codec).await
1119        }
1120        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
1121        /// for checking compatibility
1122        pub async fn get_compatibility_params(
1123            &mut self,
1124            request: impl tonic::IntoRequest<super::Empty>,
1125        ) -> std::result::Result<
1126            tonic::Response<super::CompatibilityParamsRpc>,
1127            tonic::Status,
1128        > {
1129            self.inner
1130                .ready()
1131                .await
1132                .map_err(|e| {
1133                    tonic::Status::unknown(
1134                        format!("Service was not ready: {}", e.into()),
1135                    )
1136                })?;
1137            let codec = tonic::codec::ProstCodec::default();
1138            let path = http::uri::PathAndQuery::from_static(
1139                "/clementine.ClementineOperator/GetCompatibilityParams",
1140            );
1141            let mut req = request.into_request();
1142            req.extensions_mut()
1143                .insert(
1144                    GrpcMethod::new(
1145                        "clementine.ClementineOperator",
1146                        "GetCompatibilityParams",
1147                    ),
1148                );
1149            self.inner.unary(req, path, codec).await
1150        }
1151        /// Returns an operator's parameters. It will be called once, by the
1152        /// aggregator, to set all the public keys.
1153        ///
1154        /// # Returns
1155        ///
1156        /// Returns an [`OperatorParams`], which includes operator's configuration and
1157        /// Watchtower parameters.
1158        ///
1159        /// Used by aggregator inside setup
1160        pub async fn get_params(
1161            &mut self,
1162            request: impl tonic::IntoRequest<super::Empty>,
1163        ) -> std::result::Result<
1164            tonic::Response<tonic::codec::Streaming<super::OperatorParams>>,
1165            tonic::Status,
1166        > {
1167            self.inner
1168                .ready()
1169                .await
1170                .map_err(|e| {
1171                    tonic::Status::unknown(
1172                        format!("Service was not ready: {}", e.into()),
1173                    )
1174                })?;
1175            let codec = tonic::codec::ProstCodec::default();
1176            let path = http::uri::PathAndQuery::from_static(
1177                "/clementine.ClementineOperator/GetParams",
1178            );
1179            let mut req = request.into_request();
1180            req.extensions_mut()
1181                .insert(GrpcMethod::new("clementine.ClementineOperator", "GetParams"));
1182            self.inner.server_streaming(req, path, codec).await
1183        }
1184        /// Returns an operator's deposit keys.
1185        /// Deposit keys include Assert BitVM winternitz keys, and challenge ACK hashes.
1186        ///
1187        /// Used by aggregator inside new_deposit
1188        pub async fn get_deposit_keys(
1189            &mut self,
1190            request: impl tonic::IntoRequest<super::DepositParams>,
1191        ) -> std::result::Result<tonic::Response<super::OperatorKeys>, tonic::Status> {
1192            self.inner
1193                .ready()
1194                .await
1195                .map_err(|e| {
1196                    tonic::Status::unknown(
1197                        format!("Service was not ready: {}", e.into()),
1198                    )
1199                })?;
1200            let codec = tonic::codec::ProstCodec::default();
1201            let path = http::uri::PathAndQuery::from_static(
1202                "/clementine.ClementineOperator/GetDepositKeys",
1203            );
1204            let mut req = request.into_request();
1205            req.extensions_mut()
1206                .insert(
1207                    GrpcMethod::new("clementine.ClementineOperator", "GetDepositKeys"),
1208                );
1209            self.inner.unary(req, path, codec).await
1210        }
1211        /// Returns the current status of tasks running on the operator and their last synced heights.
1212        pub async fn get_current_status(
1213            &mut self,
1214            request: impl tonic::IntoRequest<super::Empty>,
1215        ) -> std::result::Result<tonic::Response<super::EntityStatus>, tonic::Status> {
1216            self.inner
1217                .ready()
1218                .await
1219                .map_err(|e| {
1220                    tonic::Status::unknown(
1221                        format!("Service was not ready: {}", e.into()),
1222                    )
1223                })?;
1224            let codec = tonic::codec::ProstCodec::default();
1225            let path = http::uri::PathAndQuery::from_static(
1226                "/clementine.ClementineOperator/GetCurrentStatus",
1227            );
1228            let mut req = request.into_request();
1229            req.extensions_mut()
1230                .insert(
1231                    GrpcMethod::new("clementine.ClementineOperator", "GetCurrentStatus"),
1232                );
1233            self.inner.unary(req, path, codec).await
1234        }
1235        /// Sends the given outpoints to the operator's btc wallet.
1236        /// The transaction will also be broadcasted to the network.
1237        /// Each outpoint must pay to the operator's taproot address (xonly key, no merkle root).
1238        /// The rpc also checks if any outpoint is the collateral of the operator, and rejects the request if so.
1239        /// # Parameters
1240        /// - outpoints: The outpoints to send to the operator's btc wallet
1241        /// # Returns
1242        /// - Raw signed tx that transfers the given outpoints to the operator's btc wallet address
1243        pub async fn transfer_to_btc_wallet(
1244            &mut self,
1245            request: impl tonic::IntoRequest<super::Outpoints>,
1246        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status> {
1247            self.inner
1248                .ready()
1249                .await
1250                .map_err(|e| {
1251                    tonic::Status::unknown(
1252                        format!("Service was not ready: {}", e.into()),
1253                    )
1254                })?;
1255            let codec = tonic::codec::ProstCodec::default();
1256            let path = http::uri::PathAndQuery::from_static(
1257                "/clementine.ClementineOperator/TransferToBtcWallet",
1258            );
1259            let mut req = request.into_request();
1260            req.extensions_mut()
1261                .insert(
1262                    GrpcMethod::new(
1263                        "clementine.ClementineOperator",
1264                        "TransferToBtcWallet",
1265                    ),
1266                );
1267            self.inner.unary(req, path, codec).await
1268        }
1269        /// Signs everything that includes Operator's burn connector.
1270        ///
1271        /// # Parameters
1272        ///
1273        /// - User's deposit information
1274        /// - Nonce metadata
1275        ///
1276        /// # Returns
1277        ///
1278        /// - Operator burn Schnorr signature
1279        pub async fn deposit_sign(
1280            &mut self,
1281            request: impl tonic::IntoRequest<super::DepositSignSession>,
1282        ) -> std::result::Result<
1283            tonic::Response<tonic::codec::Streaming<super::SchnorrSig>>,
1284            tonic::Status,
1285        > {
1286            self.inner
1287                .ready()
1288                .await
1289                .map_err(|e| {
1290                    tonic::Status::unknown(
1291                        format!("Service was not ready: {}", e.into()),
1292                    )
1293                })?;
1294            let codec = tonic::codec::ProstCodec::default();
1295            let path = http::uri::PathAndQuery::from_static(
1296                "/clementine.ClementineOperator/DepositSign",
1297            );
1298            let mut req = request.into_request();
1299            req.extensions_mut()
1300                .insert(GrpcMethod::new("clementine.ClementineOperator", "DepositSign"));
1301            self.inner.server_streaming(req, path, codec).await
1302        }
1303        /// Restarts the background tasks for the operator.
1304        pub async fn restart_background_tasks(
1305            &mut self,
1306            request: impl tonic::IntoRequest<super::Empty>,
1307        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1308            self.inner
1309                .ready()
1310                .await
1311                .map_err(|e| {
1312                    tonic::Status::unknown(
1313                        format!("Service was not ready: {}", e.into()),
1314                    )
1315                })?;
1316            let codec = tonic::codec::ProstCodec::default();
1317            let path = http::uri::PathAndQuery::from_static(
1318                "/clementine.ClementineOperator/RestartBackgroundTasks",
1319            );
1320            let mut req = request.into_request();
1321            req.extensions_mut()
1322                .insert(
1323                    GrpcMethod::new(
1324                        "clementine.ClementineOperator",
1325                        "RestartBackgroundTasks",
1326                    ),
1327                );
1328            self.inner.unary(req, path, codec).await
1329        }
1330        /// Prepares a withdrawal if it's profitable and the withdrawal is correct and registered in Citrea bridge contract.
1331        /// If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned.
1332        /// If automation is disabled, the withdrawal will not be accepted and an error will be returned.
1333        /// Note: This is intended for operator's own use, so it doesn't include a signature from aggregator.
1334        pub async fn internal_withdraw(
1335            &mut self,
1336            request: impl tonic::IntoRequest<super::WithdrawParams>,
1337        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status> {
1338            self.inner
1339                .ready()
1340                .await
1341                .map_err(|e| {
1342                    tonic::Status::unknown(
1343                        format!("Service was not ready: {}", e.into()),
1344                    )
1345                })?;
1346            let codec = tonic::codec::ProstCodec::default();
1347            let path = http::uri::PathAndQuery::from_static(
1348                "/clementine.ClementineOperator/InternalWithdraw",
1349            );
1350            let mut req = request.into_request();
1351            req.extensions_mut()
1352                .insert(
1353                    GrpcMethod::new("clementine.ClementineOperator", "InternalWithdraw"),
1354                );
1355            self.inner.unary(req, path, codec).await
1356        }
1357        /// First, if verification address in operator's config is set, the signature in rpc is checked to see if it was signed by the verification address.
1358        /// Then prepares a withdrawal if it's profitable and the withdrawal is correct and registered in Citrea bridge contract.
1359        /// If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned.
1360        /// If automation is disabled, the withdrawal will not be accepted and an error will be returned.
1361        pub async fn withdraw(
1362            &mut self,
1363            request: impl tonic::IntoRequest<super::WithdrawParamsWithSig>,
1364        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status> {
1365            self.inner
1366                .ready()
1367                .await
1368                .map_err(|e| {
1369                    tonic::Status::unknown(
1370                        format!("Service was not ready: {}", e.into()),
1371                    )
1372                })?;
1373            let codec = tonic::codec::ProstCodec::default();
1374            let path = http::uri::PathAndQuery::from_static(
1375                "/clementine.ClementineOperator/Withdraw",
1376            );
1377            let mut req = request.into_request();
1378            req.extensions_mut()
1379                .insert(GrpcMethod::new("clementine.ClementineOperator", "Withdraw"));
1380            self.inner.unary(req, path, codec).await
1381        }
1382        /// For a given deposit outpoint, determines the next step in the kickoff process the operator is in,
1383        /// and returns the raw signed txs that the operator needs to send next, for enabling reimbursement process
1384        /// without automation.
1385        ///
1386        /// # Parameters
1387        /// - deposit_outpoint: Deposit outpoint to create the kickoff for
1388        ///
1389        /// # Returns
1390        /// - Raw signed txs that the operator needs to send next
1391        pub async fn get_reimbursement_txs(
1392            &mut self,
1393            request: impl tonic::IntoRequest<super::Outpoint>,
1394        ) -> std::result::Result<
1395            tonic::Response<super::SignedTxsWithType>,
1396            tonic::Status,
1397        > {
1398            self.inner
1399                .ready()
1400                .await
1401                .map_err(|e| {
1402                    tonic::Status::unknown(
1403                        format!("Service was not ready: {}", e.into()),
1404                    )
1405                })?;
1406            let codec = tonic::codec::ProstCodec::default();
1407            let path = http::uri::PathAndQuery::from_static(
1408                "/clementine.ClementineOperator/GetReimbursementTxs",
1409            );
1410            let mut req = request.into_request();
1411            req.extensions_mut()
1412                .insert(
1413                    GrpcMethod::new(
1414                        "clementine.ClementineOperator",
1415                        "GetReimbursementTxs",
1416                    ),
1417                );
1418            self.inner.unary(req, path, codec).await
1419        }
1420        /// Signs all tx's it can according to given transaction type (use it with AllNeededForDeposit to get almost all tx's)
1421        /// Creates the transactions denoted by the deposit and operator_idx, round_idx, and kickoff_idx.
1422        /// It will create the transaction and sign it with the operator's private key and/or saved nofn signatures.
1423        ///
1424        /// # Parameters
1425        /// - deposit_params: User's deposit information
1426        /// - transaction_type: Requested Transaction type
1427        /// - kickoff_id: Operator's kickoff ID
1428        ///
1429        /// # Returns
1430        /// - Raw signed transactions that the entity can sign (no asserts and watchtower challenge)
1431        ///
1432        /// Only used in tests
1433        pub async fn internal_create_signed_txs(
1434            &mut self,
1435            request: impl tonic::IntoRequest<super::TransactionRequest>,
1436        ) -> std::result::Result<
1437            tonic::Response<super::SignedTxsWithType>,
1438            tonic::Status,
1439        > {
1440            self.inner
1441                .ready()
1442                .await
1443                .map_err(|e| {
1444                    tonic::Status::unknown(
1445                        format!("Service was not ready: {}", e.into()),
1446                    )
1447                })?;
1448            let codec = tonic::codec::ProstCodec::default();
1449            let path = http::uri::PathAndQuery::from_static(
1450                "/clementine.ClementineOperator/InternalCreateSignedTxs",
1451            );
1452            let mut req = request.into_request();
1453            req.extensions_mut()
1454                .insert(
1455                    GrpcMethod::new(
1456                        "clementine.ClementineOperator",
1457                        "InternalCreateSignedTxs",
1458                    ),
1459                );
1460            self.inner.unary(req, path, codec).await
1461        }
1462        /// Creates all assert transactions (AssertBegin, MiniAsserts, AssertEnd), signs them, and returns the raw txs
1463        /// in the same order.
1464        /// # Parameters
1465        /// - deposit_params: User's deposit information
1466        /// - kickoff_id: Operator's kickoff ID
1467        /// - commit_data: Commitment data for each MiniAssert tx's
1468        ///
1469        /// # Returns
1470        /// - Raw signed assert transactions
1471        pub async fn internal_create_assert_commitment_txs(
1472            &mut self,
1473            request: impl tonic::IntoRequest<super::TransactionRequest>,
1474        ) -> std::result::Result<
1475            tonic::Response<super::SignedTxsWithType>,
1476            tonic::Status,
1477        > {
1478            self.inner
1479                .ready()
1480                .await
1481                .map_err(|e| {
1482                    tonic::Status::unknown(
1483                        format!("Service was not ready: {}", e.into()),
1484                    )
1485                })?;
1486            let codec = tonic::codec::ProstCodec::default();
1487            let path = http::uri::PathAndQuery::from_static(
1488                "/clementine.ClementineOperator/InternalCreateAssertCommitmentTxs",
1489            );
1490            let mut req = request.into_request();
1491            req.extensions_mut()
1492                .insert(
1493                    GrpcMethod::new(
1494                        "clementine.ClementineOperator",
1495                        "InternalCreateAssertCommitmentTxs",
1496                    ),
1497                );
1498            self.inner.unary(req, path, codec).await
1499        }
1500        pub async fn internal_finalized_payout(
1501            &mut self,
1502            request: impl tonic::IntoRequest<super::FinalizedPayoutParams>,
1503        ) -> std::result::Result<tonic::Response<super::Txid>, tonic::Status> {
1504            self.inner
1505                .ready()
1506                .await
1507                .map_err(|e| {
1508                    tonic::Status::unknown(
1509                        format!("Service was not ready: {}", e.into()),
1510                    )
1511                })?;
1512            let codec = tonic::codec::ProstCodec::default();
1513            let path = http::uri::PathAndQuery::from_static(
1514                "/clementine.ClementineOperator/InternalFinalizedPayout",
1515            );
1516            let mut req = request.into_request();
1517            req.extensions_mut()
1518                .insert(
1519                    GrpcMethod::new(
1520                        "clementine.ClementineOperator",
1521                        "InternalFinalizedPayout",
1522                    ),
1523                );
1524            self.inner.unary(req, path, codec).await
1525        }
1526        pub async fn internal_end_round(
1527            &mut self,
1528            request: impl tonic::IntoRequest<super::Empty>,
1529        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1530            self.inner
1531                .ready()
1532                .await
1533                .map_err(|e| {
1534                    tonic::Status::unknown(
1535                        format!("Service was not ready: {}", e.into()),
1536                    )
1537                })?;
1538            let codec = tonic::codec::ProstCodec::default();
1539            let path = http::uri::PathAndQuery::from_static(
1540                "/clementine.ClementineOperator/InternalEndRound",
1541            );
1542            let mut req = request.into_request();
1543            req.extensions_mut()
1544                .insert(
1545                    GrpcMethod::new("clementine.ClementineOperator", "InternalEndRound"),
1546                );
1547            self.inner.unary(req, path, codec).await
1548        }
1549        pub async fn vergen(
1550            &mut self,
1551            request: impl tonic::IntoRequest<super::Empty>,
1552        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status> {
1553            self.inner
1554                .ready()
1555                .await
1556                .map_err(|e| {
1557                    tonic::Status::unknown(
1558                        format!("Service was not ready: {}", e.into()),
1559                    )
1560                })?;
1561            let codec = tonic::codec::ProstCodec::default();
1562            let path = http::uri::PathAndQuery::from_static(
1563                "/clementine.ClementineOperator/Vergen",
1564            );
1565            let mut req = request.into_request();
1566            req.extensions_mut()
1567                .insert(GrpcMethod::new("clementine.ClementineOperator", "Vergen"));
1568            self.inner.unary(req, path, codec).await
1569        }
1570    }
1571}
1572/// Generated client implementations.
1573pub mod clementine_verifier_client {
1574    #![allow(
1575        unused_variables,
1576        dead_code,
1577        missing_docs,
1578        clippy::wildcard_imports,
1579        clippy::let_unit_value,
1580    )]
1581    use tonic::codegen::*;
1582    use tonic::codegen::http::Uri;
1583    #[derive(Debug, Clone)]
1584    pub struct ClementineVerifierClient<T> {
1585        inner: tonic::client::Grpc<T>,
1586    }
1587    impl ClementineVerifierClient<tonic::transport::Channel> {
1588        /// Attempt to create a new client by connecting to a given endpoint.
1589        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1590        where
1591            D: TryInto<tonic::transport::Endpoint>,
1592            D::Error: Into<StdError>,
1593        {
1594            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1595            Ok(Self::new(conn))
1596        }
1597    }
1598    impl<T> ClementineVerifierClient<T>
1599    where
1600        T: tonic::client::GrpcService<tonic::body::BoxBody>,
1601        T::Error: Into<StdError>,
1602        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1603        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1604    {
1605        pub fn new(inner: T) -> Self {
1606            let inner = tonic::client::Grpc::new(inner);
1607            Self { inner }
1608        }
1609        pub fn with_origin(inner: T, origin: Uri) -> Self {
1610            let inner = tonic::client::Grpc::with_origin(inner, origin);
1611            Self { inner }
1612        }
1613        pub fn with_interceptor<F>(
1614            inner: T,
1615            interceptor: F,
1616        ) -> ClementineVerifierClient<InterceptedService<T, F>>
1617        where
1618            F: tonic::service::Interceptor,
1619            T::ResponseBody: Default,
1620            T: tonic::codegen::Service<
1621                http::Request<tonic::body::BoxBody>,
1622                Response = http::Response<
1623                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1624                >,
1625            >,
1626            <T as tonic::codegen::Service<
1627                http::Request<tonic::body::BoxBody>,
1628            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1629        {
1630            ClementineVerifierClient::new(InterceptedService::new(inner, interceptor))
1631        }
1632        /// Compress requests with the given encoding.
1633        ///
1634        /// This requires the server to support it otherwise it might respond with an
1635        /// error.
1636        #[must_use]
1637        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1638            self.inner = self.inner.send_compressed(encoding);
1639            self
1640        }
1641        /// Enable decompressing responses.
1642        #[must_use]
1643        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1644            self.inner = self.inner.accept_compressed(encoding);
1645            self
1646        }
1647        /// Limits the maximum size of a decoded message.
1648        ///
1649        /// Default: `4MB`
1650        #[must_use]
1651        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1652            self.inner = self.inner.max_decoding_message_size(limit);
1653            self
1654        }
1655        /// Limits the maximum size of an encoded message.
1656        ///
1657        /// Default: `usize::MAX`
1658        #[must_use]
1659        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1660            self.inner = self.inner.max_encoding_message_size(limit);
1661            self
1662        }
1663        /// Returns verifiers' metadata. Needs to be called once per setup.
1664        ///
1665        /// Used by aggregator inside setup to let all verifiers know all other verifier pks
1666        pub async fn get_params(
1667            &mut self,
1668            request: impl tonic::IntoRequest<super::Empty>,
1669        ) -> std::result::Result<tonic::Response<super::VerifierParams>, tonic::Status> {
1670            self.inner
1671                .ready()
1672                .await
1673                .map_err(|e| {
1674                    tonic::Status::unknown(
1675                        format!("Service was not ready: {}", e.into()),
1676                    )
1677                })?;
1678            let codec = tonic::codec::ProstCodec::default();
1679            let path = http::uri::PathAndQuery::from_static(
1680                "/clementine.ClementineVerifier/GetParams",
1681            );
1682            let mut req = request.into_request();
1683            req.extensions_mut()
1684                .insert(GrpcMethod::new("clementine.ClementineVerifier", "GetParams"));
1685            self.inner.unary(req, path, codec).await
1686        }
1687        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
1688        /// for checking compatibility
1689        pub async fn get_compatibility_params(
1690            &mut self,
1691            request: impl tonic::IntoRequest<super::Empty>,
1692        ) -> std::result::Result<
1693            tonic::Response<super::CompatibilityParamsRpc>,
1694            tonic::Status,
1695        > {
1696            self.inner
1697                .ready()
1698                .await
1699                .map_err(|e| {
1700                    tonic::Status::unknown(
1701                        format!("Service was not ready: {}", e.into()),
1702                    )
1703                })?;
1704            let codec = tonic::codec::ProstCodec::default();
1705            let path = http::uri::PathAndQuery::from_static(
1706                "/clementine.ClementineVerifier/GetCompatibilityParams",
1707            );
1708            let mut req = request.into_request();
1709            req.extensions_mut()
1710                .insert(
1711                    GrpcMethod::new(
1712                        "clementine.ClementineVerifier",
1713                        "GetCompatibilityParams",
1714                    ),
1715                );
1716            self.inner.unary(req, path, codec).await
1717        }
1718        /// Saves an operator.
1719        ///
1720        /// Used by aggregator inside setup to let all verifiers know all other operator pks
1721        pub async fn set_operator(
1722            &mut self,
1723            request: impl tonic::IntoStreamingRequest<Message = super::OperatorParams>,
1724        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1725            self.inner
1726                .ready()
1727                .await
1728                .map_err(|e| {
1729                    tonic::Status::unknown(
1730                        format!("Service was not ready: {}", e.into()),
1731                    )
1732                })?;
1733            let codec = tonic::codec::ProstCodec::default();
1734            let path = http::uri::PathAndQuery::from_static(
1735                "/clementine.ClementineVerifier/SetOperator",
1736            );
1737            let mut req = request.into_streaming_request();
1738            req.extensions_mut()
1739                .insert(GrpcMethod::new("clementine.ClementineVerifier", "SetOperator"));
1740            self.inner.client_streaming(req, path, codec).await
1741        }
1742        /// Sets the operator's winternitz keys and challenge ACK hashes and saves them
1743        /// into the db.
1744        ///
1745        /// Used by aggregator inside new_deposit to let all verifiers know all other operators' deposit information
1746        pub async fn set_operator_keys(
1747            &mut self,
1748            request: impl tonic::IntoRequest<super::OperatorKeysWithDeposit>,
1749        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1750            self.inner
1751                .ready()
1752                .await
1753                .map_err(|e| {
1754                    tonic::Status::unknown(
1755                        format!("Service was not ready: {}", e.into()),
1756                    )
1757                })?;
1758            let codec = tonic::codec::ProstCodec::default();
1759            let path = http::uri::PathAndQuery::from_static(
1760                "/clementine.ClementineVerifier/SetOperatorKeys",
1761            );
1762            let mut req = request.into_request();
1763            req.extensions_mut()
1764                .insert(
1765                    GrpcMethod::new("clementine.ClementineVerifier", "SetOperatorKeys"),
1766                );
1767            self.inner.unary(req, path, codec).await
1768        }
1769        /// Generates nonces for a deposit.
1770        ///
1771        /// # Returns
1772        ///
1773        /// Nonce metadata followed by nonces.
1774        ///
1775        /// Used by aggregator inside new_deposit
1776        pub async fn nonce_gen(
1777            &mut self,
1778            request: impl tonic::IntoRequest<super::NonceGenRequest>,
1779        ) -> std::result::Result<
1780            tonic::Response<tonic::codec::Streaming<super::NonceGenResponse>>,
1781            tonic::Status,
1782        > {
1783            self.inner
1784                .ready()
1785                .await
1786                .map_err(|e| {
1787                    tonic::Status::unknown(
1788                        format!("Service was not ready: {}", e.into()),
1789                    )
1790                })?;
1791            let codec = tonic::codec::ProstCodec::default();
1792            let path = http::uri::PathAndQuery::from_static(
1793                "/clementine.ClementineVerifier/NonceGen",
1794            );
1795            let mut req = request.into_request();
1796            req.extensions_mut()
1797                .insert(GrpcMethod::new("clementine.ClementineVerifier", "NonceGen"));
1798            self.inner.server_streaming(req, path, codec).await
1799        }
1800        /// Signs deposit with given aggNonces and verifier's secNonce using
1801        /// nonce_id.
1802        ///
1803        /// Used by aggregator inside new_deposit
1804        pub async fn deposit_sign(
1805            &mut self,
1806            request: impl tonic::IntoStreamingRequest<
1807                Message = super::VerifierDepositSignParams,
1808            >,
1809        ) -> std::result::Result<
1810            tonic::Response<tonic::codec::Streaming<super::PartialSig>>,
1811            tonic::Status,
1812        > {
1813            self.inner
1814                .ready()
1815                .await
1816                .map_err(|e| {
1817                    tonic::Status::unknown(
1818                        format!("Service was not ready: {}", e.into()),
1819                    )
1820                })?;
1821            let codec = tonic::codec::ProstCodec::default();
1822            let path = http::uri::PathAndQuery::from_static(
1823                "/clementine.ClementineVerifier/DepositSign",
1824            );
1825            let mut req = request.into_streaming_request();
1826            req.extensions_mut()
1827                .insert(GrpcMethod::new("clementine.ClementineVerifier", "DepositSign"));
1828            self.inner.streaming(req, path, codec).await
1829        }
1830        /// Signs the optimistic payout tx with given aggNonce and withdrawal info.
1831        pub async fn optimistic_payout_sign(
1832            &mut self,
1833            request: impl tonic::IntoRequest<super::OptimisticPayoutParams>,
1834        ) -> std::result::Result<tonic::Response<super::PartialSig>, tonic::Status> {
1835            self.inner
1836                .ready()
1837                .await
1838                .map_err(|e| {
1839                    tonic::Status::unknown(
1840                        format!("Service was not ready: {}", e.into()),
1841                    )
1842                })?;
1843            let codec = tonic::codec::ProstCodec::default();
1844            let path = http::uri::PathAndQuery::from_static(
1845                "/clementine.ClementineVerifier/OptimisticPayoutSign",
1846            );
1847            let mut req = request.into_request();
1848            req.extensions_mut()
1849                .insert(
1850                    GrpcMethod::new(
1851                        "clementine.ClementineVerifier",
1852                        "OptimisticPayoutSign",
1853                    ),
1854                );
1855            self.inner.unary(req, path, codec).await
1856        }
1857        /// Verifies every signature and signs move_tx.
1858        ///
1859        /// Used by aggregator inside new_deposit
1860        pub async fn deposit_finalize(
1861            &mut self,
1862            request: impl tonic::IntoStreamingRequest<
1863                Message = super::VerifierDepositFinalizeParams,
1864            >,
1865        ) -> std::result::Result<
1866            tonic::Response<super::VerifierDepositFinalizeResponse>,
1867            tonic::Status,
1868        > {
1869            self.inner
1870                .ready()
1871                .await
1872                .map_err(|e| {
1873                    tonic::Status::unknown(
1874                        format!("Service was not ready: {}", e.into()),
1875                    )
1876                })?;
1877            let codec = tonic::codec::ProstCodec::default();
1878            let path = http::uri::PathAndQuery::from_static(
1879                "/clementine.ClementineVerifier/DepositFinalize",
1880            );
1881            let mut req = request.into_streaming_request();
1882            req.extensions_mut()
1883                .insert(
1884                    GrpcMethod::new("clementine.ClementineVerifier", "DepositFinalize"),
1885                );
1886            self.inner.client_streaming(req, path, codec).await
1887        }
1888        /// Debug a transaction by retrieving its current state and history
1889        pub async fn debug_tx(
1890            &mut self,
1891            request: impl tonic::IntoRequest<super::TxDebugRequest>,
1892        ) -> std::result::Result<tonic::Response<super::TxDebugInfo>, tonic::Status> {
1893            self.inner
1894                .ready()
1895                .await
1896                .map_err(|e| {
1897                    tonic::Status::unknown(
1898                        format!("Service was not ready: {}", e.into()),
1899                    )
1900                })?;
1901            let codec = tonic::codec::ProstCodec::default();
1902            let path = http::uri::PathAndQuery::from_static(
1903                "/clementine.ClementineVerifier/DebugTx",
1904            );
1905            let mut req = request.into_request();
1906            req.extensions_mut()
1907                .insert(GrpcMethod::new("clementine.ClementineVerifier", "DebugTx"));
1908            self.inner.unary(req, path, codec).await
1909        }
1910        /// Restarts the background tasks for the verifier.
1911        pub async fn restart_background_tasks(
1912            &mut self,
1913            request: impl tonic::IntoRequest<super::Empty>,
1914        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1915            self.inner
1916                .ready()
1917                .await
1918                .map_err(|e| {
1919                    tonic::Status::unknown(
1920                        format!("Service was not ready: {}", e.into()),
1921                    )
1922                })?;
1923            let codec = tonic::codec::ProstCodec::default();
1924            let path = http::uri::PathAndQuery::from_static(
1925                "/clementine.ClementineVerifier/RestartBackgroundTasks",
1926            );
1927            let mut req = request.into_request();
1928            req.extensions_mut()
1929                .insert(
1930                    GrpcMethod::new(
1931                        "clementine.ClementineVerifier",
1932                        "RestartBackgroundTasks",
1933                    ),
1934                );
1935            self.inner.unary(req, path, codec).await
1936        }
1937        /// Checks if the kickoff tx is malicious and if so, try to send all necessary txs to punish the operator
1938        pub async fn internal_handle_kickoff(
1939            &mut self,
1940            request: impl tonic::IntoRequest<super::Txid>,
1941        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
1942            self.inner
1943                .ready()
1944                .await
1945                .map_err(|e| {
1946                    tonic::Status::unknown(
1947                        format!("Service was not ready: {}", e.into()),
1948                    )
1949                })?;
1950            let codec = tonic::codec::ProstCodec::default();
1951            let path = http::uri::PathAndQuery::from_static(
1952                "/clementine.ClementineVerifier/InternalHandleKickoff",
1953            );
1954            let mut req = request.into_request();
1955            req.extensions_mut()
1956                .insert(
1957                    GrpcMethod::new(
1958                        "clementine.ClementineVerifier",
1959                        "InternalHandleKickoff",
1960                    ),
1961                );
1962            self.inner.unary(req, path, codec).await
1963        }
1964        /// Returns the current status of tasks running on the verifier and their last synced heights.
1965        pub async fn get_current_status(
1966            &mut self,
1967            request: impl tonic::IntoRequest<super::Empty>,
1968        ) -> std::result::Result<tonic::Response<super::EntityStatus>, tonic::Status> {
1969            self.inner
1970                .ready()
1971                .await
1972                .map_err(|e| {
1973                    tonic::Status::unknown(
1974                        format!("Service was not ready: {}", e.into()),
1975                    )
1976                })?;
1977            let codec = tonic::codec::ProstCodec::default();
1978            let path = http::uri::PathAndQuery::from_static(
1979                "/clementine.ClementineVerifier/GetCurrentStatus",
1980            );
1981            let mut req = request.into_request();
1982            req.extensions_mut()
1983                .insert(
1984                    GrpcMethod::new("clementine.ClementineVerifier", "GetCurrentStatus"),
1985                );
1986            self.inner.unary(req, path, codec).await
1987        }
1988        /// 1. Signs all tx's it can according to given transaction type (use it with AllNeededForDeposit to get almost all tx's)
1989        /// 2. Creates the transactions denoted by the deposit and operator_idx, round_idx, and kickoff_idx.
1990        /// 3. It will create the transaction and sign it with the operator's private key and/or saved nofn signatures.
1991        ///
1992        /// # Parameters
1993        /// - deposit_params: User's deposit information
1994        /// - transaction_type: Requested Transaction type
1995        /// - kickoff_id: Operator's kickoff ID
1996        ///
1997        /// # Returns
1998        /// - Raw signed transactions that the entity can sign (no asserts and watchtower challenge)
1999        pub async fn internal_create_signed_txs(
2000            &mut self,
2001            request: impl tonic::IntoRequest<super::TransactionRequest>,
2002        ) -> std::result::Result<
2003            tonic::Response<super::SignedTxsWithType>,
2004            tonic::Status,
2005        > {
2006            self.inner
2007                .ready()
2008                .await
2009                .map_err(|e| {
2010                    tonic::Status::unknown(
2011                        format!("Service was not ready: {}", e.into()),
2012                    )
2013                })?;
2014            let codec = tonic::codec::ProstCodec::default();
2015            let path = http::uri::PathAndQuery::from_static(
2016                "/clementine.ClementineVerifier/InternalCreateSignedTxs",
2017            );
2018            let mut req = request.into_request();
2019            req.extensions_mut()
2020                .insert(
2021                    GrpcMethod::new(
2022                        "clementine.ClementineVerifier",
2023                        "InternalCreateSignedTxs",
2024                    ),
2025                );
2026            self.inner.unary(req, path, codec).await
2027        }
2028        /// Signs the verifiers own watchtower challenge tx in the corresponding
2029        /// kickoff and returns the signed raw tx
2030        pub async fn internal_create_watchtower_challenge(
2031            &mut self,
2032            request: impl tonic::IntoRequest<super::TransactionRequest>,
2033        ) -> std::result::Result<
2034            tonic::Response<super::RawTxWithRbfInfo>,
2035            tonic::Status,
2036        > {
2037            self.inner
2038                .ready()
2039                .await
2040                .map_err(|e| {
2041                    tonic::Status::unknown(
2042                        format!("Service was not ready: {}", e.into()),
2043                    )
2044                })?;
2045            let codec = tonic::codec::ProstCodec::default();
2046            let path = http::uri::PathAndQuery::from_static(
2047                "/clementine.ClementineVerifier/InternalCreateWatchtowerChallenge",
2048            );
2049            let mut req = request.into_request();
2050            req.extensions_mut()
2051                .insert(
2052                    GrpcMethod::new(
2053                        "clementine.ClementineVerifier",
2054                        "InternalCreateWatchtowerChallenge",
2055                    ),
2056                );
2057            self.inner.unary(req, path, codec).await
2058        }
2059        pub async fn vergen(
2060            &mut self,
2061            request: impl tonic::IntoRequest<super::Empty>,
2062        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status> {
2063            self.inner
2064                .ready()
2065                .await
2066                .map_err(|e| {
2067                    tonic::Status::unknown(
2068                        format!("Service was not ready: {}", e.into()),
2069                    )
2070                })?;
2071            let codec = tonic::codec::ProstCodec::default();
2072            let path = http::uri::PathAndQuery::from_static(
2073                "/clementine.ClementineVerifier/Vergen",
2074            );
2075            let mut req = request.into_request();
2076            req.extensions_mut()
2077                .insert(GrpcMethod::new("clementine.ClementineVerifier", "Vergen"));
2078            self.inner.unary(req, path, codec).await
2079        }
2080    }
2081}
2082/// Generated client implementations.
2083pub mod clementine_aggregator_client {
2084    #![allow(
2085        unused_variables,
2086        dead_code,
2087        missing_docs,
2088        clippy::wildcard_imports,
2089        clippy::let_unit_value,
2090    )]
2091    use tonic::codegen::*;
2092    use tonic::codegen::http::Uri;
2093    #[derive(Debug, Clone)]
2094    pub struct ClementineAggregatorClient<T> {
2095        inner: tonic::client::Grpc<T>,
2096    }
2097    impl ClementineAggregatorClient<tonic::transport::Channel> {
2098        /// Attempt to create a new client by connecting to a given endpoint.
2099        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2100        where
2101            D: TryInto<tonic::transport::Endpoint>,
2102            D::Error: Into<StdError>,
2103        {
2104            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2105            Ok(Self::new(conn))
2106        }
2107    }
2108    impl<T> ClementineAggregatorClient<T>
2109    where
2110        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2111        T::Error: Into<StdError>,
2112        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2113        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2114    {
2115        pub fn new(inner: T) -> Self {
2116            let inner = tonic::client::Grpc::new(inner);
2117            Self { inner }
2118        }
2119        pub fn with_origin(inner: T, origin: Uri) -> Self {
2120            let inner = tonic::client::Grpc::with_origin(inner, origin);
2121            Self { inner }
2122        }
2123        pub fn with_interceptor<F>(
2124            inner: T,
2125            interceptor: F,
2126        ) -> ClementineAggregatorClient<InterceptedService<T, F>>
2127        where
2128            F: tonic::service::Interceptor,
2129            T::ResponseBody: Default,
2130            T: tonic::codegen::Service<
2131                http::Request<tonic::body::BoxBody>,
2132                Response = http::Response<
2133                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2134                >,
2135            >,
2136            <T as tonic::codegen::Service<
2137                http::Request<tonic::body::BoxBody>,
2138            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2139        {
2140            ClementineAggregatorClient::new(InterceptedService::new(inner, interceptor))
2141        }
2142        /// Compress requests with the given encoding.
2143        ///
2144        /// This requires the server to support it otherwise it might respond with an
2145        /// error.
2146        #[must_use]
2147        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2148            self.inner = self.inner.send_compressed(encoding);
2149            self
2150        }
2151        /// Enable decompressing responses.
2152        #[must_use]
2153        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2154            self.inner = self.inner.accept_compressed(encoding);
2155            self
2156        }
2157        /// Limits the maximum size of a decoded message.
2158        ///
2159        /// Default: `4MB`
2160        #[must_use]
2161        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2162            self.inner = self.inner.max_decoding_message_size(limit);
2163            self
2164        }
2165        /// Limits the maximum size of an encoded message.
2166        ///
2167        /// Default: `usize::MAX`
2168        #[must_use]
2169        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2170            self.inner = self.inner.max_encoding_message_size(limit);
2171            self
2172        }
2173        pub async fn get_nofn_aggregated_xonly_pk(
2174            &mut self,
2175            request: impl tonic::IntoRequest<super::Empty>,
2176        ) -> std::result::Result<tonic::Response<super::NofnResponse>, tonic::Status> {
2177            self.inner
2178                .ready()
2179                .await
2180                .map_err(|e| {
2181                    tonic::Status::unknown(
2182                        format!("Service was not ready: {}", e.into()),
2183                    )
2184                })?;
2185            let codec = tonic::codec::ProstCodec::default();
2186            let path = http::uri::PathAndQuery::from_static(
2187                "/clementine.ClementineAggregator/GetNofnAggregatedXonlyPk",
2188            );
2189            let mut req = request.into_request();
2190            req.extensions_mut()
2191                .insert(
2192                    GrpcMethod::new(
2193                        "clementine.ClementineAggregator",
2194                        "GetNofnAggregatedXonlyPk",
2195                    ),
2196                );
2197            self.inner.unary(req, path, codec).await
2198        }
2199        /// Returns the compatibility data from all entities
2200        pub async fn get_compatibility_data_from_entities(
2201            &mut self,
2202            request: impl tonic::IntoRequest<super::Empty>,
2203        ) -> std::result::Result<
2204            tonic::Response<super::EntitiesCompatibilityData>,
2205            tonic::Status,
2206        > {
2207            self.inner
2208                .ready()
2209                .await
2210                .map_err(|e| {
2211                    tonic::Status::unknown(
2212                        format!("Service was not ready: {}", e.into()),
2213                    )
2214                })?;
2215            let codec = tonic::codec::ProstCodec::default();
2216            let path = http::uri::PathAndQuery::from_static(
2217                "/clementine.ClementineAggregator/GetCompatibilityDataFromEntities",
2218            );
2219            let mut req = request.into_request();
2220            req.extensions_mut()
2221                .insert(
2222                    GrpcMethod::new(
2223                        "clementine.ClementineAggregator",
2224                        "GetCompatibilityDataFromEntities",
2225                    ),
2226                );
2227            self.inner.unary(req, path, codec).await
2228        }
2229        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
2230        /// for checking compatibility
2231        pub async fn get_compatibility_params(
2232            &mut self,
2233            request: impl tonic::IntoRequest<super::Empty>,
2234        ) -> std::result::Result<
2235            tonic::Response<super::CompatibilityParamsRpc>,
2236            tonic::Status,
2237        > {
2238            self.inner
2239                .ready()
2240                .await
2241                .map_err(|e| {
2242                    tonic::Status::unknown(
2243                        format!("Service was not ready: {}", e.into()),
2244                    )
2245                })?;
2246            let codec = tonic::codec::ProstCodec::default();
2247            let path = http::uri::PathAndQuery::from_static(
2248                "/clementine.ClementineAggregator/GetCompatibilityParams",
2249            );
2250            let mut req = request.into_request();
2251            req.extensions_mut()
2252                .insert(
2253                    GrpcMethod::new(
2254                        "clementine.ClementineAggregator",
2255                        "GetCompatibilityParams",
2256                    ),
2257                );
2258            self.inner.unary(req, path, codec).await
2259        }
2260        /// Sets up the system of verifiers, watchtowers and operators by:
2261        ///
2262        /// 1. Collects verifier keys from each verifier
2263        /// 2. Distributes these verifier keys to all verifiers
2264        /// 3. Collects all operator configs from each operator
2265        /// 4. Distributes these operator configs to all verifiers
2266        ///
2267        /// Used by the clementine-backend service
2268        pub async fn setup(
2269            &mut self,
2270            request: impl tonic::IntoRequest<super::Empty>,
2271        ) -> std::result::Result<
2272            tonic::Response<super::VerifierPublicKeys>,
2273            tonic::Status,
2274        > {
2275            self.inner
2276                .ready()
2277                .await
2278                .map_err(|e| {
2279                    tonic::Status::unknown(
2280                        format!("Service was not ready: {}", e.into()),
2281                    )
2282                })?;
2283            let codec = tonic::codec::ProstCodec::default();
2284            let path = http::uri::PathAndQuery::from_static(
2285                "/clementine.ClementineAggregator/Setup",
2286            );
2287            let mut req = request.into_request();
2288            req.extensions_mut()
2289                .insert(GrpcMethod::new("clementine.ClementineAggregator", "Setup"));
2290            self.inner.unary(req, path, codec).await
2291        }
2292        /// This will call, DepositNonceGen for every verifier,
2293        /// then it will aggregate one by one and then send it to DepositSign,
2294        /// then it will aggregate the partial sigs and send it to DepositFinalize,
2295        /// this will also call the operator to get their signatures and send it to
2296        /// DepositFinalize then it will collect the partial sigs and create the move
2297        /// tx.
2298        ///
2299        /// Used by the clementine-backend service to initiate a deposit
2300        pub async fn new_deposit(
2301            &mut self,
2302            request: impl tonic::IntoRequest<super::Deposit>,
2303        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status> {
2304            self.inner
2305                .ready()
2306                .await
2307                .map_err(|e| {
2308                    tonic::Status::unknown(
2309                        format!("Service was not ready: {}", e.into()),
2310                    )
2311                })?;
2312            let codec = tonic::codec::ProstCodec::default();
2313            let path = http::uri::PathAndQuery::from_static(
2314                "/clementine.ClementineAggregator/NewDeposit",
2315            );
2316            let mut req = request.into_request();
2317            req.extensions_mut()
2318                .insert(
2319                    GrpcMethod::new("clementine.ClementineAggregator", "NewDeposit"),
2320                );
2321            self.inner.unary(req, path, codec).await
2322        }
2323        /// Call's withdraw on all operators
2324        /// Used by the clementine-backend service to initiate a withdrawal
2325        /// If the operator's xonly public keys list is empty, the withdrawal will be sent to all operators.
2326        /// If not, only the operators in the list will be sent the withdrawal request.
2327        pub async fn withdraw(
2328            &mut self,
2329            request: impl tonic::IntoRequest<super::AggregatorWithdrawalInput>,
2330        ) -> std::result::Result<
2331            tonic::Response<super::AggregatorWithdrawResponse>,
2332            tonic::Status,
2333        > {
2334            self.inner
2335                .ready()
2336                .await
2337                .map_err(|e| {
2338                    tonic::Status::unknown(
2339                        format!("Service was not ready: {}", e.into()),
2340                    )
2341                })?;
2342            let codec = tonic::codec::ProstCodec::default();
2343            let path = http::uri::PathAndQuery::from_static(
2344                "/clementine.ClementineAggregator/Withdraw",
2345            );
2346            let mut req = request.into_request();
2347            req.extensions_mut()
2348                .insert(GrpcMethod::new("clementine.ClementineAggregator", "Withdraw"));
2349            self.inner.unary(req, path, codec).await
2350        }
2351        /// Perform an optimistic payout to reimburse a peg-out from Citrea
2352        pub async fn optimistic_payout(
2353            &mut self,
2354            request: impl tonic::IntoRequest<super::OptimisticWithdrawParams>,
2355        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status> {
2356            self.inner
2357                .ready()
2358                .await
2359                .map_err(|e| {
2360                    tonic::Status::unknown(
2361                        format!("Service was not ready: {}", e.into()),
2362                    )
2363                })?;
2364            let codec = tonic::codec::ProstCodec::default();
2365            let path = http::uri::PathAndQuery::from_static(
2366                "/clementine.ClementineAggregator/OptimisticPayout",
2367            );
2368            let mut req = request.into_request();
2369            req.extensions_mut()
2370                .insert(
2371                    GrpcMethod::new(
2372                        "clementine.ClementineAggregator",
2373                        "OptimisticPayout",
2374                    ),
2375                );
2376            self.inner.unary(req, path, codec).await
2377        }
2378        /// Send a pre-signed tx to the network
2379        pub async fn internal_send_tx(
2380            &mut self,
2381            request: impl tonic::IntoRequest<super::SendTxRequest>,
2382        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
2383            self.inner
2384                .ready()
2385                .await
2386                .map_err(|e| {
2387                    tonic::Status::unknown(
2388                        format!("Service was not ready: {}", e.into()),
2389                    )
2390                })?;
2391            let codec = tonic::codec::ProstCodec::default();
2392            let path = http::uri::PathAndQuery::from_static(
2393                "/clementine.ClementineAggregator/InternalSendTx",
2394            );
2395            let mut req = request.into_request();
2396            req.extensions_mut()
2397                .insert(
2398                    GrpcMethod::new("clementine.ClementineAggregator", "InternalSendTx"),
2399                );
2400            self.inner.unary(req, path, codec).await
2401        }
2402        pub async fn send_move_to_vault_tx(
2403            &mut self,
2404            request: impl tonic::IntoRequest<super::SendMoveTxRequest>,
2405        ) -> std::result::Result<tonic::Response<super::Txid>, tonic::Status> {
2406            self.inner
2407                .ready()
2408                .await
2409                .map_err(|e| {
2410                    tonic::Status::unknown(
2411                        format!("Service was not ready: {}", e.into()),
2412                    )
2413                })?;
2414            let codec = tonic::codec::ProstCodec::default();
2415            let path = http::uri::PathAndQuery::from_static(
2416                "/clementine.ClementineAggregator/SendMoveToVaultTx",
2417            );
2418            let mut req = request.into_request();
2419            req.extensions_mut()
2420                .insert(
2421                    GrpcMethod::new(
2422                        "clementine.ClementineAggregator",
2423                        "SendMoveToVaultTx",
2424                    ),
2425                );
2426            self.inner.unary(req, path, codec).await
2427        }
2428        /// Returns the current status of tasks running on the operators/verifiers.
2429        /// If restart_tasks is true, it will restart the tasks on the entities if they are stopped.
2430        pub async fn get_entity_statuses(
2431            &mut self,
2432            request: impl tonic::IntoRequest<super::GetEntityStatusesRequest>,
2433        ) -> std::result::Result<tonic::Response<super::EntityStatuses>, tonic::Status> {
2434            self.inner
2435                .ready()
2436                .await
2437                .map_err(|e| {
2438                    tonic::Status::unknown(
2439                        format!("Service was not ready: {}", e.into()),
2440                    )
2441                })?;
2442            let codec = tonic::codec::ProstCodec::default();
2443            let path = http::uri::PathAndQuery::from_static(
2444                "/clementine.ClementineAggregator/GetEntityStatuses",
2445            );
2446            let mut req = request.into_request();
2447            req.extensions_mut()
2448                .insert(
2449                    GrpcMethod::new(
2450                        "clementine.ClementineAggregator",
2451                        "GetEntityStatuses",
2452                    ),
2453                );
2454            self.inner.unary(req, path, codec).await
2455        }
2456        /// Creates an emergency stop tx that won't be broadcasted.
2457        /// Tx will have around 3 sats/vbyte fee.
2458        /// Set add_anchor to true to add an anchor output for cpfp..
2459        pub async fn internal_get_emergency_stop_tx(
2460            &mut self,
2461            request: impl tonic::IntoRequest<super::GetEmergencyStopTxRequest>,
2462        ) -> std::result::Result<
2463            tonic::Response<super::GetEmergencyStopTxResponse>,
2464            tonic::Status,
2465        > {
2466            self.inner
2467                .ready()
2468                .await
2469                .map_err(|e| {
2470                    tonic::Status::unknown(
2471                        format!("Service was not ready: {}", e.into()),
2472                    )
2473                })?;
2474            let codec = tonic::codec::ProstCodec::default();
2475            let path = http::uri::PathAndQuery::from_static(
2476                "/clementine.ClementineAggregator/InternalGetEmergencyStopTx",
2477            );
2478            let mut req = request.into_request();
2479            req.extensions_mut()
2480                .insert(
2481                    GrpcMethod::new(
2482                        "clementine.ClementineAggregator",
2483                        "InternalGetEmergencyStopTx",
2484                    ),
2485                );
2486            self.inner.unary(req, path, codec).await
2487        }
2488        pub async fn vergen(
2489            &mut self,
2490            request: impl tonic::IntoRequest<super::Empty>,
2491        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status> {
2492            self.inner
2493                .ready()
2494                .await
2495                .map_err(|e| {
2496                    tonic::Status::unknown(
2497                        format!("Service was not ready: {}", e.into()),
2498                    )
2499                })?;
2500            let codec = tonic::codec::ProstCodec::default();
2501            let path = http::uri::PathAndQuery::from_static(
2502                "/clementine.ClementineAggregator/Vergen",
2503            );
2504            let mut req = request.into_request();
2505            req.extensions_mut()
2506                .insert(GrpcMethod::new("clementine.ClementineAggregator", "Vergen"));
2507            self.inner.unary(req, path, codec).await
2508        }
2509    }
2510}
2511/// Generated server implementations.
2512pub mod clementine_operator_server {
2513    #![allow(
2514        unused_variables,
2515        dead_code,
2516        missing_docs,
2517        clippy::wildcard_imports,
2518        clippy::let_unit_value,
2519    )]
2520    use tonic::codegen::*;
2521    /// Generated trait containing gRPC methods that should be implemented for use with ClementineOperatorServer.
2522    #[async_trait]
2523    pub trait ClementineOperator: std::marker::Send + std::marker::Sync + 'static {
2524        /// Returns the operator's xonly public key
2525        ///
2526        /// Used by aggregator inside setup
2527        async fn get_x_only_public_key(
2528            &self,
2529            request: tonic::Request<super::Empty>,
2530        ) -> std::result::Result<
2531            tonic::Response<super::XOnlyPublicKeyRpc>,
2532            tonic::Status,
2533        >;
2534        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
2535        /// for checking compatibility
2536        async fn get_compatibility_params(
2537            &self,
2538            request: tonic::Request<super::Empty>,
2539        ) -> std::result::Result<
2540            tonic::Response<super::CompatibilityParamsRpc>,
2541            tonic::Status,
2542        >;
2543        /// Server streaming response type for the GetParams method.
2544        type GetParamsStream: tonic::codegen::tokio_stream::Stream<
2545                Item = std::result::Result<super::OperatorParams, tonic::Status>,
2546            >
2547            + std::marker::Send
2548            + 'static;
2549        /// Returns an operator's parameters. It will be called once, by the
2550        /// aggregator, to set all the public keys.
2551        ///
2552        /// # Returns
2553        ///
2554        /// Returns an [`OperatorParams`], which includes operator's configuration and
2555        /// Watchtower parameters.
2556        ///
2557        /// Used by aggregator inside setup
2558        async fn get_params(
2559            &self,
2560            request: tonic::Request<super::Empty>,
2561        ) -> std::result::Result<tonic::Response<Self::GetParamsStream>, tonic::Status>;
2562        /// Returns an operator's deposit keys.
2563        /// Deposit keys include Assert BitVM winternitz keys, and challenge ACK hashes.
2564        ///
2565        /// Used by aggregator inside new_deposit
2566        async fn get_deposit_keys(
2567            &self,
2568            request: tonic::Request<super::DepositParams>,
2569        ) -> std::result::Result<tonic::Response<super::OperatorKeys>, tonic::Status>;
2570        /// Returns the current status of tasks running on the operator and their last synced heights.
2571        async fn get_current_status(
2572            &self,
2573            request: tonic::Request<super::Empty>,
2574        ) -> std::result::Result<tonic::Response<super::EntityStatus>, tonic::Status>;
2575        /// Sends the given outpoints to the operator's btc wallet.
2576        /// The transaction will also be broadcasted to the network.
2577        /// Each outpoint must pay to the operator's taproot address (xonly key, no merkle root).
2578        /// The rpc also checks if any outpoint is the collateral of the operator, and rejects the request if so.
2579        /// # Parameters
2580        /// - outpoints: The outpoints to send to the operator's btc wallet
2581        /// # Returns
2582        /// - Raw signed tx that transfers the given outpoints to the operator's btc wallet address
2583        async fn transfer_to_btc_wallet(
2584            &self,
2585            request: tonic::Request<super::Outpoints>,
2586        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status>;
2587        /// Server streaming response type for the DepositSign method.
2588        type DepositSignStream: tonic::codegen::tokio_stream::Stream<
2589                Item = std::result::Result<super::SchnorrSig, tonic::Status>,
2590            >
2591            + std::marker::Send
2592            + 'static;
2593        /// Signs everything that includes Operator's burn connector.
2594        ///
2595        /// # Parameters
2596        ///
2597        /// - User's deposit information
2598        /// - Nonce metadata
2599        ///
2600        /// # Returns
2601        ///
2602        /// - Operator burn Schnorr signature
2603        async fn deposit_sign(
2604            &self,
2605            request: tonic::Request<super::DepositSignSession>,
2606        ) -> std::result::Result<
2607            tonic::Response<Self::DepositSignStream>,
2608            tonic::Status,
2609        >;
2610        /// Restarts the background tasks for the operator.
2611        async fn restart_background_tasks(
2612            &self,
2613            request: tonic::Request<super::Empty>,
2614        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
2615        /// Prepares a withdrawal if it's profitable and the withdrawal is correct and registered in Citrea bridge contract.
2616        /// If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned.
2617        /// If automation is disabled, the withdrawal will not be accepted and an error will be returned.
2618        /// Note: This is intended for operator's own use, so it doesn't include a signature from aggregator.
2619        async fn internal_withdraw(
2620            &self,
2621            request: tonic::Request<super::WithdrawParams>,
2622        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status>;
2623        /// First, if verification address in operator's config is set, the signature in rpc is checked to see if it was signed by the verification address.
2624        /// Then prepares a withdrawal if it's profitable and the withdrawal is correct and registered in Citrea bridge contract.
2625        /// If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned.
2626        /// If automation is disabled, the withdrawal will not be accepted and an error will be returned.
2627        async fn withdraw(
2628            &self,
2629            request: tonic::Request<super::WithdrawParamsWithSig>,
2630        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status>;
2631        /// For a given deposit outpoint, determines the next step in the kickoff process the operator is in,
2632        /// and returns the raw signed txs that the operator needs to send next, for enabling reimbursement process
2633        /// without automation.
2634        ///
2635        /// # Parameters
2636        /// - deposit_outpoint: Deposit outpoint to create the kickoff for
2637        ///
2638        /// # Returns
2639        /// - Raw signed txs that the operator needs to send next
2640        async fn get_reimbursement_txs(
2641            &self,
2642            request: tonic::Request<super::Outpoint>,
2643        ) -> std::result::Result<
2644            tonic::Response<super::SignedTxsWithType>,
2645            tonic::Status,
2646        >;
2647        /// Signs all tx's it can according to given transaction type (use it with AllNeededForDeposit to get almost all tx's)
2648        /// Creates the transactions denoted by the deposit and operator_idx, round_idx, and kickoff_idx.
2649        /// It will create the transaction and sign it with the operator's private key and/or saved nofn signatures.
2650        ///
2651        /// # Parameters
2652        /// - deposit_params: User's deposit information
2653        /// - transaction_type: Requested Transaction type
2654        /// - kickoff_id: Operator's kickoff ID
2655        ///
2656        /// # Returns
2657        /// - Raw signed transactions that the entity can sign (no asserts and watchtower challenge)
2658        ///
2659        /// Only used in tests
2660        async fn internal_create_signed_txs(
2661            &self,
2662            request: tonic::Request<super::TransactionRequest>,
2663        ) -> std::result::Result<
2664            tonic::Response<super::SignedTxsWithType>,
2665            tonic::Status,
2666        >;
2667        /// Creates all assert transactions (AssertBegin, MiniAsserts, AssertEnd), signs them, and returns the raw txs
2668        /// in the same order.
2669        /// # Parameters
2670        /// - deposit_params: User's deposit information
2671        /// - kickoff_id: Operator's kickoff ID
2672        /// - commit_data: Commitment data for each MiniAssert tx's
2673        ///
2674        /// # Returns
2675        /// - Raw signed assert transactions
2676        async fn internal_create_assert_commitment_txs(
2677            &self,
2678            request: tonic::Request<super::TransactionRequest>,
2679        ) -> std::result::Result<
2680            tonic::Response<super::SignedTxsWithType>,
2681            tonic::Status,
2682        >;
2683        async fn internal_finalized_payout(
2684            &self,
2685            request: tonic::Request<super::FinalizedPayoutParams>,
2686        ) -> std::result::Result<tonic::Response<super::Txid>, tonic::Status>;
2687        async fn internal_end_round(
2688            &self,
2689            request: tonic::Request<super::Empty>,
2690        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
2691        async fn vergen(
2692            &self,
2693            request: tonic::Request<super::Empty>,
2694        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status>;
2695    }
2696    /// An operator is responsible for paying withdrawals. It has an unique ID and
2697    /// chain of UTXOs named `round_txs`. An operator also runs a verifier. These are
2698    /// connected to the same database and both have access to watchtowers'
2699    /// winternitz pubkeys.
2700    #[derive(Debug)]
2701    pub struct ClementineOperatorServer<T> {
2702        inner: Arc<T>,
2703        accept_compression_encodings: EnabledCompressionEncodings,
2704        send_compression_encodings: EnabledCompressionEncodings,
2705        max_decoding_message_size: Option<usize>,
2706        max_encoding_message_size: Option<usize>,
2707    }
2708    impl<T> ClementineOperatorServer<T> {
2709        pub fn new(inner: T) -> Self {
2710            Self::from_arc(Arc::new(inner))
2711        }
2712        pub fn from_arc(inner: Arc<T>) -> Self {
2713            Self {
2714                inner,
2715                accept_compression_encodings: Default::default(),
2716                send_compression_encodings: Default::default(),
2717                max_decoding_message_size: None,
2718                max_encoding_message_size: None,
2719            }
2720        }
2721        pub fn with_interceptor<F>(
2722            inner: T,
2723            interceptor: F,
2724        ) -> InterceptedService<Self, F>
2725        where
2726            F: tonic::service::Interceptor,
2727        {
2728            InterceptedService::new(Self::new(inner), interceptor)
2729        }
2730        /// Enable decompressing requests with the given encoding.
2731        #[must_use]
2732        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2733            self.accept_compression_encodings.enable(encoding);
2734            self
2735        }
2736        /// Compress responses with the given encoding, if the client supports it.
2737        #[must_use]
2738        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2739            self.send_compression_encodings.enable(encoding);
2740            self
2741        }
2742        /// Limits the maximum size of a decoded message.
2743        ///
2744        /// Default: `4MB`
2745        #[must_use]
2746        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2747            self.max_decoding_message_size = Some(limit);
2748            self
2749        }
2750        /// Limits the maximum size of an encoded message.
2751        ///
2752        /// Default: `usize::MAX`
2753        #[must_use]
2754        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2755            self.max_encoding_message_size = Some(limit);
2756            self
2757        }
2758    }
2759    impl<T, B> tonic::codegen::Service<http::Request<B>> for ClementineOperatorServer<T>
2760    where
2761        T: ClementineOperator,
2762        B: Body + std::marker::Send + 'static,
2763        B::Error: Into<StdError> + std::marker::Send + 'static,
2764    {
2765        type Response = http::Response<tonic::body::BoxBody>;
2766        type Error = std::convert::Infallible;
2767        type Future = BoxFuture<Self::Response, Self::Error>;
2768        fn poll_ready(
2769            &mut self,
2770            _cx: &mut Context<'_>,
2771        ) -> Poll<std::result::Result<(), Self::Error>> {
2772            Poll::Ready(Ok(()))
2773        }
2774        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2775            match req.uri().path() {
2776                "/clementine.ClementineOperator/GetXOnlyPublicKey" => {
2777                    #[allow(non_camel_case_types)]
2778                    struct GetXOnlyPublicKeySvc<T: ClementineOperator>(pub Arc<T>);
2779                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
2780                    for GetXOnlyPublicKeySvc<T> {
2781                        type Response = super::XOnlyPublicKeyRpc;
2782                        type Future = BoxFuture<
2783                            tonic::Response<Self::Response>,
2784                            tonic::Status,
2785                        >;
2786                        fn call(
2787                            &mut self,
2788                            request: tonic::Request<super::Empty>,
2789                        ) -> Self::Future {
2790                            let inner = Arc::clone(&self.0);
2791                            let fut = async move {
2792                                <T as ClementineOperator>::get_x_only_public_key(
2793                                        &inner,
2794                                        request,
2795                                    )
2796                                    .await
2797                            };
2798                            Box::pin(fut)
2799                        }
2800                    }
2801                    let accept_compression_encodings = self.accept_compression_encodings;
2802                    let send_compression_encodings = self.send_compression_encodings;
2803                    let max_decoding_message_size = self.max_decoding_message_size;
2804                    let max_encoding_message_size = self.max_encoding_message_size;
2805                    let inner = self.inner.clone();
2806                    let fut = async move {
2807                        let method = GetXOnlyPublicKeySvc(inner);
2808                        let codec = tonic::codec::ProstCodec::default();
2809                        let mut grpc = tonic::server::Grpc::new(codec)
2810                            .apply_compression_config(
2811                                accept_compression_encodings,
2812                                send_compression_encodings,
2813                            )
2814                            .apply_max_message_size_config(
2815                                max_decoding_message_size,
2816                                max_encoding_message_size,
2817                            );
2818                        let res = grpc.unary(method, req).await;
2819                        Ok(res)
2820                    };
2821                    Box::pin(fut)
2822                }
2823                "/clementine.ClementineOperator/GetCompatibilityParams" => {
2824                    #[allow(non_camel_case_types)]
2825                    struct GetCompatibilityParamsSvc<T: ClementineOperator>(pub Arc<T>);
2826                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
2827                    for GetCompatibilityParamsSvc<T> {
2828                        type Response = super::CompatibilityParamsRpc;
2829                        type Future = BoxFuture<
2830                            tonic::Response<Self::Response>,
2831                            tonic::Status,
2832                        >;
2833                        fn call(
2834                            &mut self,
2835                            request: tonic::Request<super::Empty>,
2836                        ) -> Self::Future {
2837                            let inner = Arc::clone(&self.0);
2838                            let fut = async move {
2839                                <T as ClementineOperator>::get_compatibility_params(
2840                                        &inner,
2841                                        request,
2842                                    )
2843                                    .await
2844                            };
2845                            Box::pin(fut)
2846                        }
2847                    }
2848                    let accept_compression_encodings = self.accept_compression_encodings;
2849                    let send_compression_encodings = self.send_compression_encodings;
2850                    let max_decoding_message_size = self.max_decoding_message_size;
2851                    let max_encoding_message_size = self.max_encoding_message_size;
2852                    let inner = self.inner.clone();
2853                    let fut = async move {
2854                        let method = GetCompatibilityParamsSvc(inner);
2855                        let codec = tonic::codec::ProstCodec::default();
2856                        let mut grpc = tonic::server::Grpc::new(codec)
2857                            .apply_compression_config(
2858                                accept_compression_encodings,
2859                                send_compression_encodings,
2860                            )
2861                            .apply_max_message_size_config(
2862                                max_decoding_message_size,
2863                                max_encoding_message_size,
2864                            );
2865                        let res = grpc.unary(method, req).await;
2866                        Ok(res)
2867                    };
2868                    Box::pin(fut)
2869                }
2870                "/clementine.ClementineOperator/GetParams" => {
2871                    #[allow(non_camel_case_types)]
2872                    struct GetParamsSvc<T: ClementineOperator>(pub Arc<T>);
2873                    impl<
2874                        T: ClementineOperator,
2875                    > tonic::server::ServerStreamingService<super::Empty>
2876                    for GetParamsSvc<T> {
2877                        type Response = super::OperatorParams;
2878                        type ResponseStream = T::GetParamsStream;
2879                        type Future = BoxFuture<
2880                            tonic::Response<Self::ResponseStream>,
2881                            tonic::Status,
2882                        >;
2883                        fn call(
2884                            &mut self,
2885                            request: tonic::Request<super::Empty>,
2886                        ) -> Self::Future {
2887                            let inner = Arc::clone(&self.0);
2888                            let fut = async move {
2889                                <T as ClementineOperator>::get_params(&inner, request).await
2890                            };
2891                            Box::pin(fut)
2892                        }
2893                    }
2894                    let accept_compression_encodings = self.accept_compression_encodings;
2895                    let send_compression_encodings = self.send_compression_encodings;
2896                    let max_decoding_message_size = self.max_decoding_message_size;
2897                    let max_encoding_message_size = self.max_encoding_message_size;
2898                    let inner = self.inner.clone();
2899                    let fut = async move {
2900                        let method = GetParamsSvc(inner);
2901                        let codec = tonic::codec::ProstCodec::default();
2902                        let mut grpc = tonic::server::Grpc::new(codec)
2903                            .apply_compression_config(
2904                                accept_compression_encodings,
2905                                send_compression_encodings,
2906                            )
2907                            .apply_max_message_size_config(
2908                                max_decoding_message_size,
2909                                max_encoding_message_size,
2910                            );
2911                        let res = grpc.server_streaming(method, req).await;
2912                        Ok(res)
2913                    };
2914                    Box::pin(fut)
2915                }
2916                "/clementine.ClementineOperator/GetDepositKeys" => {
2917                    #[allow(non_camel_case_types)]
2918                    struct GetDepositKeysSvc<T: ClementineOperator>(pub Arc<T>);
2919                    impl<
2920                        T: ClementineOperator,
2921                    > tonic::server::UnaryService<super::DepositParams>
2922                    for GetDepositKeysSvc<T> {
2923                        type Response = super::OperatorKeys;
2924                        type Future = BoxFuture<
2925                            tonic::Response<Self::Response>,
2926                            tonic::Status,
2927                        >;
2928                        fn call(
2929                            &mut self,
2930                            request: tonic::Request<super::DepositParams>,
2931                        ) -> Self::Future {
2932                            let inner = Arc::clone(&self.0);
2933                            let fut = async move {
2934                                <T as ClementineOperator>::get_deposit_keys(&inner, request)
2935                                    .await
2936                            };
2937                            Box::pin(fut)
2938                        }
2939                    }
2940                    let accept_compression_encodings = self.accept_compression_encodings;
2941                    let send_compression_encodings = self.send_compression_encodings;
2942                    let max_decoding_message_size = self.max_decoding_message_size;
2943                    let max_encoding_message_size = self.max_encoding_message_size;
2944                    let inner = self.inner.clone();
2945                    let fut = async move {
2946                        let method = GetDepositKeysSvc(inner);
2947                        let codec = tonic::codec::ProstCodec::default();
2948                        let mut grpc = tonic::server::Grpc::new(codec)
2949                            .apply_compression_config(
2950                                accept_compression_encodings,
2951                                send_compression_encodings,
2952                            )
2953                            .apply_max_message_size_config(
2954                                max_decoding_message_size,
2955                                max_encoding_message_size,
2956                            );
2957                        let res = grpc.unary(method, req).await;
2958                        Ok(res)
2959                    };
2960                    Box::pin(fut)
2961                }
2962                "/clementine.ClementineOperator/GetCurrentStatus" => {
2963                    #[allow(non_camel_case_types)]
2964                    struct GetCurrentStatusSvc<T: ClementineOperator>(pub Arc<T>);
2965                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
2966                    for GetCurrentStatusSvc<T> {
2967                        type Response = super::EntityStatus;
2968                        type Future = BoxFuture<
2969                            tonic::Response<Self::Response>,
2970                            tonic::Status,
2971                        >;
2972                        fn call(
2973                            &mut self,
2974                            request: tonic::Request<super::Empty>,
2975                        ) -> Self::Future {
2976                            let inner = Arc::clone(&self.0);
2977                            let fut = async move {
2978                                <T as ClementineOperator>::get_current_status(
2979                                        &inner,
2980                                        request,
2981                                    )
2982                                    .await
2983                            };
2984                            Box::pin(fut)
2985                        }
2986                    }
2987                    let accept_compression_encodings = self.accept_compression_encodings;
2988                    let send_compression_encodings = self.send_compression_encodings;
2989                    let max_decoding_message_size = self.max_decoding_message_size;
2990                    let max_encoding_message_size = self.max_encoding_message_size;
2991                    let inner = self.inner.clone();
2992                    let fut = async move {
2993                        let method = GetCurrentStatusSvc(inner);
2994                        let codec = tonic::codec::ProstCodec::default();
2995                        let mut grpc = tonic::server::Grpc::new(codec)
2996                            .apply_compression_config(
2997                                accept_compression_encodings,
2998                                send_compression_encodings,
2999                            )
3000                            .apply_max_message_size_config(
3001                                max_decoding_message_size,
3002                                max_encoding_message_size,
3003                            );
3004                        let res = grpc.unary(method, req).await;
3005                        Ok(res)
3006                    };
3007                    Box::pin(fut)
3008                }
3009                "/clementine.ClementineOperator/TransferToBtcWallet" => {
3010                    #[allow(non_camel_case_types)]
3011                    struct TransferToBtcWalletSvc<T: ClementineOperator>(pub Arc<T>);
3012                    impl<
3013                        T: ClementineOperator,
3014                    > tonic::server::UnaryService<super::Outpoints>
3015                    for TransferToBtcWalletSvc<T> {
3016                        type Response = super::RawSignedTx;
3017                        type Future = BoxFuture<
3018                            tonic::Response<Self::Response>,
3019                            tonic::Status,
3020                        >;
3021                        fn call(
3022                            &mut self,
3023                            request: tonic::Request<super::Outpoints>,
3024                        ) -> Self::Future {
3025                            let inner = Arc::clone(&self.0);
3026                            let fut = async move {
3027                                <T as ClementineOperator>::transfer_to_btc_wallet(
3028                                        &inner,
3029                                        request,
3030                                    )
3031                                    .await
3032                            };
3033                            Box::pin(fut)
3034                        }
3035                    }
3036                    let accept_compression_encodings = self.accept_compression_encodings;
3037                    let send_compression_encodings = self.send_compression_encodings;
3038                    let max_decoding_message_size = self.max_decoding_message_size;
3039                    let max_encoding_message_size = self.max_encoding_message_size;
3040                    let inner = self.inner.clone();
3041                    let fut = async move {
3042                        let method = TransferToBtcWalletSvc(inner);
3043                        let codec = tonic::codec::ProstCodec::default();
3044                        let mut grpc = tonic::server::Grpc::new(codec)
3045                            .apply_compression_config(
3046                                accept_compression_encodings,
3047                                send_compression_encodings,
3048                            )
3049                            .apply_max_message_size_config(
3050                                max_decoding_message_size,
3051                                max_encoding_message_size,
3052                            );
3053                        let res = grpc.unary(method, req).await;
3054                        Ok(res)
3055                    };
3056                    Box::pin(fut)
3057                }
3058                "/clementine.ClementineOperator/DepositSign" => {
3059                    #[allow(non_camel_case_types)]
3060                    struct DepositSignSvc<T: ClementineOperator>(pub Arc<T>);
3061                    impl<
3062                        T: ClementineOperator,
3063                    > tonic::server::ServerStreamingService<super::DepositSignSession>
3064                    for DepositSignSvc<T> {
3065                        type Response = super::SchnorrSig;
3066                        type ResponseStream = T::DepositSignStream;
3067                        type Future = BoxFuture<
3068                            tonic::Response<Self::ResponseStream>,
3069                            tonic::Status,
3070                        >;
3071                        fn call(
3072                            &mut self,
3073                            request: tonic::Request<super::DepositSignSession>,
3074                        ) -> Self::Future {
3075                            let inner = Arc::clone(&self.0);
3076                            let fut = async move {
3077                                <T as ClementineOperator>::deposit_sign(&inner, request)
3078                                    .await
3079                            };
3080                            Box::pin(fut)
3081                        }
3082                    }
3083                    let accept_compression_encodings = self.accept_compression_encodings;
3084                    let send_compression_encodings = self.send_compression_encodings;
3085                    let max_decoding_message_size = self.max_decoding_message_size;
3086                    let max_encoding_message_size = self.max_encoding_message_size;
3087                    let inner = self.inner.clone();
3088                    let fut = async move {
3089                        let method = DepositSignSvc(inner);
3090                        let codec = tonic::codec::ProstCodec::default();
3091                        let mut grpc = tonic::server::Grpc::new(codec)
3092                            .apply_compression_config(
3093                                accept_compression_encodings,
3094                                send_compression_encodings,
3095                            )
3096                            .apply_max_message_size_config(
3097                                max_decoding_message_size,
3098                                max_encoding_message_size,
3099                            );
3100                        let res = grpc.server_streaming(method, req).await;
3101                        Ok(res)
3102                    };
3103                    Box::pin(fut)
3104                }
3105                "/clementine.ClementineOperator/RestartBackgroundTasks" => {
3106                    #[allow(non_camel_case_types)]
3107                    struct RestartBackgroundTasksSvc<T: ClementineOperator>(pub Arc<T>);
3108                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
3109                    for RestartBackgroundTasksSvc<T> {
3110                        type Response = super::Empty;
3111                        type Future = BoxFuture<
3112                            tonic::Response<Self::Response>,
3113                            tonic::Status,
3114                        >;
3115                        fn call(
3116                            &mut self,
3117                            request: tonic::Request<super::Empty>,
3118                        ) -> Self::Future {
3119                            let inner = Arc::clone(&self.0);
3120                            let fut = async move {
3121                                <T as ClementineOperator>::restart_background_tasks(
3122                                        &inner,
3123                                        request,
3124                                    )
3125                                    .await
3126                            };
3127                            Box::pin(fut)
3128                        }
3129                    }
3130                    let accept_compression_encodings = self.accept_compression_encodings;
3131                    let send_compression_encodings = self.send_compression_encodings;
3132                    let max_decoding_message_size = self.max_decoding_message_size;
3133                    let max_encoding_message_size = self.max_encoding_message_size;
3134                    let inner = self.inner.clone();
3135                    let fut = async move {
3136                        let method = RestartBackgroundTasksSvc(inner);
3137                        let codec = tonic::codec::ProstCodec::default();
3138                        let mut grpc = tonic::server::Grpc::new(codec)
3139                            .apply_compression_config(
3140                                accept_compression_encodings,
3141                                send_compression_encodings,
3142                            )
3143                            .apply_max_message_size_config(
3144                                max_decoding_message_size,
3145                                max_encoding_message_size,
3146                            );
3147                        let res = grpc.unary(method, req).await;
3148                        Ok(res)
3149                    };
3150                    Box::pin(fut)
3151                }
3152                "/clementine.ClementineOperator/InternalWithdraw" => {
3153                    #[allow(non_camel_case_types)]
3154                    struct InternalWithdrawSvc<T: ClementineOperator>(pub Arc<T>);
3155                    impl<
3156                        T: ClementineOperator,
3157                    > tonic::server::UnaryService<super::WithdrawParams>
3158                    for InternalWithdrawSvc<T> {
3159                        type Response = super::RawSignedTx;
3160                        type Future = BoxFuture<
3161                            tonic::Response<Self::Response>,
3162                            tonic::Status,
3163                        >;
3164                        fn call(
3165                            &mut self,
3166                            request: tonic::Request<super::WithdrawParams>,
3167                        ) -> Self::Future {
3168                            let inner = Arc::clone(&self.0);
3169                            let fut = async move {
3170                                <T as ClementineOperator>::internal_withdraw(
3171                                        &inner,
3172                                        request,
3173                                    )
3174                                    .await
3175                            };
3176                            Box::pin(fut)
3177                        }
3178                    }
3179                    let accept_compression_encodings = self.accept_compression_encodings;
3180                    let send_compression_encodings = self.send_compression_encodings;
3181                    let max_decoding_message_size = self.max_decoding_message_size;
3182                    let max_encoding_message_size = self.max_encoding_message_size;
3183                    let inner = self.inner.clone();
3184                    let fut = async move {
3185                        let method = InternalWithdrawSvc(inner);
3186                        let codec = tonic::codec::ProstCodec::default();
3187                        let mut grpc = tonic::server::Grpc::new(codec)
3188                            .apply_compression_config(
3189                                accept_compression_encodings,
3190                                send_compression_encodings,
3191                            )
3192                            .apply_max_message_size_config(
3193                                max_decoding_message_size,
3194                                max_encoding_message_size,
3195                            );
3196                        let res = grpc.unary(method, req).await;
3197                        Ok(res)
3198                    };
3199                    Box::pin(fut)
3200                }
3201                "/clementine.ClementineOperator/Withdraw" => {
3202                    #[allow(non_camel_case_types)]
3203                    struct WithdrawSvc<T: ClementineOperator>(pub Arc<T>);
3204                    impl<
3205                        T: ClementineOperator,
3206                    > tonic::server::UnaryService<super::WithdrawParamsWithSig>
3207                    for WithdrawSvc<T> {
3208                        type Response = super::RawSignedTx;
3209                        type Future = BoxFuture<
3210                            tonic::Response<Self::Response>,
3211                            tonic::Status,
3212                        >;
3213                        fn call(
3214                            &mut self,
3215                            request: tonic::Request<super::WithdrawParamsWithSig>,
3216                        ) -> Self::Future {
3217                            let inner = Arc::clone(&self.0);
3218                            let fut = async move {
3219                                <T as ClementineOperator>::withdraw(&inner, request).await
3220                            };
3221                            Box::pin(fut)
3222                        }
3223                    }
3224                    let accept_compression_encodings = self.accept_compression_encodings;
3225                    let send_compression_encodings = self.send_compression_encodings;
3226                    let max_decoding_message_size = self.max_decoding_message_size;
3227                    let max_encoding_message_size = self.max_encoding_message_size;
3228                    let inner = self.inner.clone();
3229                    let fut = async move {
3230                        let method = WithdrawSvc(inner);
3231                        let codec = tonic::codec::ProstCodec::default();
3232                        let mut grpc = tonic::server::Grpc::new(codec)
3233                            .apply_compression_config(
3234                                accept_compression_encodings,
3235                                send_compression_encodings,
3236                            )
3237                            .apply_max_message_size_config(
3238                                max_decoding_message_size,
3239                                max_encoding_message_size,
3240                            );
3241                        let res = grpc.unary(method, req).await;
3242                        Ok(res)
3243                    };
3244                    Box::pin(fut)
3245                }
3246                "/clementine.ClementineOperator/GetReimbursementTxs" => {
3247                    #[allow(non_camel_case_types)]
3248                    struct GetReimbursementTxsSvc<T: ClementineOperator>(pub Arc<T>);
3249                    impl<
3250                        T: ClementineOperator,
3251                    > tonic::server::UnaryService<super::Outpoint>
3252                    for GetReimbursementTxsSvc<T> {
3253                        type Response = super::SignedTxsWithType;
3254                        type Future = BoxFuture<
3255                            tonic::Response<Self::Response>,
3256                            tonic::Status,
3257                        >;
3258                        fn call(
3259                            &mut self,
3260                            request: tonic::Request<super::Outpoint>,
3261                        ) -> Self::Future {
3262                            let inner = Arc::clone(&self.0);
3263                            let fut = async move {
3264                                <T as ClementineOperator>::get_reimbursement_txs(
3265                                        &inner,
3266                                        request,
3267                                    )
3268                                    .await
3269                            };
3270                            Box::pin(fut)
3271                        }
3272                    }
3273                    let accept_compression_encodings = self.accept_compression_encodings;
3274                    let send_compression_encodings = self.send_compression_encodings;
3275                    let max_decoding_message_size = self.max_decoding_message_size;
3276                    let max_encoding_message_size = self.max_encoding_message_size;
3277                    let inner = self.inner.clone();
3278                    let fut = async move {
3279                        let method = GetReimbursementTxsSvc(inner);
3280                        let codec = tonic::codec::ProstCodec::default();
3281                        let mut grpc = tonic::server::Grpc::new(codec)
3282                            .apply_compression_config(
3283                                accept_compression_encodings,
3284                                send_compression_encodings,
3285                            )
3286                            .apply_max_message_size_config(
3287                                max_decoding_message_size,
3288                                max_encoding_message_size,
3289                            );
3290                        let res = grpc.unary(method, req).await;
3291                        Ok(res)
3292                    };
3293                    Box::pin(fut)
3294                }
3295                "/clementine.ClementineOperator/InternalCreateSignedTxs" => {
3296                    #[allow(non_camel_case_types)]
3297                    struct InternalCreateSignedTxsSvc<T: ClementineOperator>(pub Arc<T>);
3298                    impl<
3299                        T: ClementineOperator,
3300                    > tonic::server::UnaryService<super::TransactionRequest>
3301                    for InternalCreateSignedTxsSvc<T> {
3302                        type Response = super::SignedTxsWithType;
3303                        type Future = BoxFuture<
3304                            tonic::Response<Self::Response>,
3305                            tonic::Status,
3306                        >;
3307                        fn call(
3308                            &mut self,
3309                            request: tonic::Request<super::TransactionRequest>,
3310                        ) -> Self::Future {
3311                            let inner = Arc::clone(&self.0);
3312                            let fut = async move {
3313                                <T as ClementineOperator>::internal_create_signed_txs(
3314                                        &inner,
3315                                        request,
3316                                    )
3317                                    .await
3318                            };
3319                            Box::pin(fut)
3320                        }
3321                    }
3322                    let accept_compression_encodings = self.accept_compression_encodings;
3323                    let send_compression_encodings = self.send_compression_encodings;
3324                    let max_decoding_message_size = self.max_decoding_message_size;
3325                    let max_encoding_message_size = self.max_encoding_message_size;
3326                    let inner = self.inner.clone();
3327                    let fut = async move {
3328                        let method = InternalCreateSignedTxsSvc(inner);
3329                        let codec = tonic::codec::ProstCodec::default();
3330                        let mut grpc = tonic::server::Grpc::new(codec)
3331                            .apply_compression_config(
3332                                accept_compression_encodings,
3333                                send_compression_encodings,
3334                            )
3335                            .apply_max_message_size_config(
3336                                max_decoding_message_size,
3337                                max_encoding_message_size,
3338                            );
3339                        let res = grpc.unary(method, req).await;
3340                        Ok(res)
3341                    };
3342                    Box::pin(fut)
3343                }
3344                "/clementine.ClementineOperator/InternalCreateAssertCommitmentTxs" => {
3345                    #[allow(non_camel_case_types)]
3346                    struct InternalCreateAssertCommitmentTxsSvc<T: ClementineOperator>(
3347                        pub Arc<T>,
3348                    );
3349                    impl<
3350                        T: ClementineOperator,
3351                    > tonic::server::UnaryService<super::TransactionRequest>
3352                    for InternalCreateAssertCommitmentTxsSvc<T> {
3353                        type Response = super::SignedTxsWithType;
3354                        type Future = BoxFuture<
3355                            tonic::Response<Self::Response>,
3356                            tonic::Status,
3357                        >;
3358                        fn call(
3359                            &mut self,
3360                            request: tonic::Request<super::TransactionRequest>,
3361                        ) -> Self::Future {
3362                            let inner = Arc::clone(&self.0);
3363                            let fut = async move {
3364                                <T as ClementineOperator>::internal_create_assert_commitment_txs(
3365                                        &inner,
3366                                        request,
3367                                    )
3368                                    .await
3369                            };
3370                            Box::pin(fut)
3371                        }
3372                    }
3373                    let accept_compression_encodings = self.accept_compression_encodings;
3374                    let send_compression_encodings = self.send_compression_encodings;
3375                    let max_decoding_message_size = self.max_decoding_message_size;
3376                    let max_encoding_message_size = self.max_encoding_message_size;
3377                    let inner = self.inner.clone();
3378                    let fut = async move {
3379                        let method = InternalCreateAssertCommitmentTxsSvc(inner);
3380                        let codec = tonic::codec::ProstCodec::default();
3381                        let mut grpc = tonic::server::Grpc::new(codec)
3382                            .apply_compression_config(
3383                                accept_compression_encodings,
3384                                send_compression_encodings,
3385                            )
3386                            .apply_max_message_size_config(
3387                                max_decoding_message_size,
3388                                max_encoding_message_size,
3389                            );
3390                        let res = grpc.unary(method, req).await;
3391                        Ok(res)
3392                    };
3393                    Box::pin(fut)
3394                }
3395                "/clementine.ClementineOperator/InternalFinalizedPayout" => {
3396                    #[allow(non_camel_case_types)]
3397                    struct InternalFinalizedPayoutSvc<T: ClementineOperator>(pub Arc<T>);
3398                    impl<
3399                        T: ClementineOperator,
3400                    > tonic::server::UnaryService<super::FinalizedPayoutParams>
3401                    for InternalFinalizedPayoutSvc<T> {
3402                        type Response = super::Txid;
3403                        type Future = BoxFuture<
3404                            tonic::Response<Self::Response>,
3405                            tonic::Status,
3406                        >;
3407                        fn call(
3408                            &mut self,
3409                            request: tonic::Request<super::FinalizedPayoutParams>,
3410                        ) -> Self::Future {
3411                            let inner = Arc::clone(&self.0);
3412                            let fut = async move {
3413                                <T as ClementineOperator>::internal_finalized_payout(
3414                                        &inner,
3415                                        request,
3416                                    )
3417                                    .await
3418                            };
3419                            Box::pin(fut)
3420                        }
3421                    }
3422                    let accept_compression_encodings = self.accept_compression_encodings;
3423                    let send_compression_encodings = self.send_compression_encodings;
3424                    let max_decoding_message_size = self.max_decoding_message_size;
3425                    let max_encoding_message_size = self.max_encoding_message_size;
3426                    let inner = self.inner.clone();
3427                    let fut = async move {
3428                        let method = InternalFinalizedPayoutSvc(inner);
3429                        let codec = tonic::codec::ProstCodec::default();
3430                        let mut grpc = tonic::server::Grpc::new(codec)
3431                            .apply_compression_config(
3432                                accept_compression_encodings,
3433                                send_compression_encodings,
3434                            )
3435                            .apply_max_message_size_config(
3436                                max_decoding_message_size,
3437                                max_encoding_message_size,
3438                            );
3439                        let res = grpc.unary(method, req).await;
3440                        Ok(res)
3441                    };
3442                    Box::pin(fut)
3443                }
3444                "/clementine.ClementineOperator/InternalEndRound" => {
3445                    #[allow(non_camel_case_types)]
3446                    struct InternalEndRoundSvc<T: ClementineOperator>(pub Arc<T>);
3447                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
3448                    for InternalEndRoundSvc<T> {
3449                        type Response = super::Empty;
3450                        type Future = BoxFuture<
3451                            tonic::Response<Self::Response>,
3452                            tonic::Status,
3453                        >;
3454                        fn call(
3455                            &mut self,
3456                            request: tonic::Request<super::Empty>,
3457                        ) -> Self::Future {
3458                            let inner = Arc::clone(&self.0);
3459                            let fut = async move {
3460                                <T as ClementineOperator>::internal_end_round(
3461                                        &inner,
3462                                        request,
3463                                    )
3464                                    .await
3465                            };
3466                            Box::pin(fut)
3467                        }
3468                    }
3469                    let accept_compression_encodings = self.accept_compression_encodings;
3470                    let send_compression_encodings = self.send_compression_encodings;
3471                    let max_decoding_message_size = self.max_decoding_message_size;
3472                    let max_encoding_message_size = self.max_encoding_message_size;
3473                    let inner = self.inner.clone();
3474                    let fut = async move {
3475                        let method = InternalEndRoundSvc(inner);
3476                        let codec = tonic::codec::ProstCodec::default();
3477                        let mut grpc = tonic::server::Grpc::new(codec)
3478                            .apply_compression_config(
3479                                accept_compression_encodings,
3480                                send_compression_encodings,
3481                            )
3482                            .apply_max_message_size_config(
3483                                max_decoding_message_size,
3484                                max_encoding_message_size,
3485                            );
3486                        let res = grpc.unary(method, req).await;
3487                        Ok(res)
3488                    };
3489                    Box::pin(fut)
3490                }
3491                "/clementine.ClementineOperator/Vergen" => {
3492                    #[allow(non_camel_case_types)]
3493                    struct VergenSvc<T: ClementineOperator>(pub Arc<T>);
3494                    impl<T: ClementineOperator> tonic::server::UnaryService<super::Empty>
3495                    for VergenSvc<T> {
3496                        type Response = super::VergenResponse;
3497                        type Future = BoxFuture<
3498                            tonic::Response<Self::Response>,
3499                            tonic::Status,
3500                        >;
3501                        fn call(
3502                            &mut self,
3503                            request: tonic::Request<super::Empty>,
3504                        ) -> Self::Future {
3505                            let inner = Arc::clone(&self.0);
3506                            let fut = async move {
3507                                <T as ClementineOperator>::vergen(&inner, request).await
3508                            };
3509                            Box::pin(fut)
3510                        }
3511                    }
3512                    let accept_compression_encodings = self.accept_compression_encodings;
3513                    let send_compression_encodings = self.send_compression_encodings;
3514                    let max_decoding_message_size = self.max_decoding_message_size;
3515                    let max_encoding_message_size = self.max_encoding_message_size;
3516                    let inner = self.inner.clone();
3517                    let fut = async move {
3518                        let method = VergenSvc(inner);
3519                        let codec = tonic::codec::ProstCodec::default();
3520                        let mut grpc = tonic::server::Grpc::new(codec)
3521                            .apply_compression_config(
3522                                accept_compression_encodings,
3523                                send_compression_encodings,
3524                            )
3525                            .apply_max_message_size_config(
3526                                max_decoding_message_size,
3527                                max_encoding_message_size,
3528                            );
3529                        let res = grpc.unary(method, req).await;
3530                        Ok(res)
3531                    };
3532                    Box::pin(fut)
3533                }
3534                _ => {
3535                    Box::pin(async move {
3536                        let mut response = http::Response::new(empty_body());
3537                        let headers = response.headers_mut();
3538                        headers
3539                            .insert(
3540                                tonic::Status::GRPC_STATUS,
3541                                (tonic::Code::Unimplemented as i32).into(),
3542                            );
3543                        headers
3544                            .insert(
3545                                http::header::CONTENT_TYPE,
3546                                tonic::metadata::GRPC_CONTENT_TYPE,
3547                            );
3548                        Ok(response)
3549                    })
3550                }
3551            }
3552        }
3553    }
3554    impl<T> Clone for ClementineOperatorServer<T> {
3555        fn clone(&self) -> Self {
3556            let inner = self.inner.clone();
3557            Self {
3558                inner,
3559                accept_compression_encodings: self.accept_compression_encodings,
3560                send_compression_encodings: self.send_compression_encodings,
3561                max_decoding_message_size: self.max_decoding_message_size,
3562                max_encoding_message_size: self.max_encoding_message_size,
3563            }
3564        }
3565    }
3566    /// Generated gRPC service name
3567    pub const SERVICE_NAME: &str = "clementine.ClementineOperator";
3568    impl<T> tonic::server::NamedService for ClementineOperatorServer<T> {
3569        const NAME: &'static str = SERVICE_NAME;
3570    }
3571}
3572/// Generated server implementations.
3573pub mod clementine_verifier_server {
3574    #![allow(
3575        unused_variables,
3576        dead_code,
3577        missing_docs,
3578        clippy::wildcard_imports,
3579        clippy::let_unit_value,
3580    )]
3581    use tonic::codegen::*;
3582    /// Generated trait containing gRPC methods that should be implemented for use with ClementineVerifierServer.
3583    #[async_trait]
3584    pub trait ClementineVerifier: std::marker::Send + std::marker::Sync + 'static {
3585        /// Returns verifiers' metadata. Needs to be called once per setup.
3586        ///
3587        /// Used by aggregator inside setup to let all verifiers know all other verifier pks
3588        async fn get_params(
3589            &self,
3590            request: tonic::Request<super::Empty>,
3591        ) -> std::result::Result<tonic::Response<super::VerifierParams>, tonic::Status>;
3592        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
3593        /// for checking compatibility
3594        async fn get_compatibility_params(
3595            &self,
3596            request: tonic::Request<super::Empty>,
3597        ) -> std::result::Result<
3598            tonic::Response<super::CompatibilityParamsRpc>,
3599            tonic::Status,
3600        >;
3601        /// Saves an operator.
3602        ///
3603        /// Used by aggregator inside setup to let all verifiers know all other operator pks
3604        async fn set_operator(
3605            &self,
3606            request: tonic::Request<tonic::Streaming<super::OperatorParams>>,
3607        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
3608        /// Sets the operator's winternitz keys and challenge ACK hashes and saves them
3609        /// into the db.
3610        ///
3611        /// Used by aggregator inside new_deposit to let all verifiers know all other operators' deposit information
3612        async fn set_operator_keys(
3613            &self,
3614            request: tonic::Request<super::OperatorKeysWithDeposit>,
3615        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
3616        /// Server streaming response type for the NonceGen method.
3617        type NonceGenStream: tonic::codegen::tokio_stream::Stream<
3618                Item = std::result::Result<super::NonceGenResponse, tonic::Status>,
3619            >
3620            + std::marker::Send
3621            + 'static;
3622        /// Generates nonces for a deposit.
3623        ///
3624        /// # Returns
3625        ///
3626        /// Nonce metadata followed by nonces.
3627        ///
3628        /// Used by aggregator inside new_deposit
3629        async fn nonce_gen(
3630            &self,
3631            request: tonic::Request<super::NonceGenRequest>,
3632        ) -> std::result::Result<tonic::Response<Self::NonceGenStream>, tonic::Status>;
3633        /// Server streaming response type for the DepositSign method.
3634        type DepositSignStream: tonic::codegen::tokio_stream::Stream<
3635                Item = std::result::Result<super::PartialSig, tonic::Status>,
3636            >
3637            + std::marker::Send
3638            + 'static;
3639        /// Signs deposit with given aggNonces and verifier's secNonce using
3640        /// nonce_id.
3641        ///
3642        /// Used by aggregator inside new_deposit
3643        async fn deposit_sign(
3644            &self,
3645            request: tonic::Request<tonic::Streaming<super::VerifierDepositSignParams>>,
3646        ) -> std::result::Result<
3647            tonic::Response<Self::DepositSignStream>,
3648            tonic::Status,
3649        >;
3650        /// Signs the optimistic payout tx with given aggNonce and withdrawal info.
3651        async fn optimistic_payout_sign(
3652            &self,
3653            request: tonic::Request<super::OptimisticPayoutParams>,
3654        ) -> std::result::Result<tonic::Response<super::PartialSig>, tonic::Status>;
3655        /// Verifies every signature and signs move_tx.
3656        ///
3657        /// Used by aggregator inside new_deposit
3658        async fn deposit_finalize(
3659            &self,
3660            request: tonic::Request<
3661                tonic::Streaming<super::VerifierDepositFinalizeParams>,
3662            >,
3663        ) -> std::result::Result<
3664            tonic::Response<super::VerifierDepositFinalizeResponse>,
3665            tonic::Status,
3666        >;
3667        /// Debug a transaction by retrieving its current state and history
3668        async fn debug_tx(
3669            &self,
3670            request: tonic::Request<super::TxDebugRequest>,
3671        ) -> std::result::Result<tonic::Response<super::TxDebugInfo>, tonic::Status>;
3672        /// Restarts the background tasks for the verifier.
3673        async fn restart_background_tasks(
3674            &self,
3675            request: tonic::Request<super::Empty>,
3676        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
3677        /// Checks if the kickoff tx is malicious and if so, try to send all necessary txs to punish the operator
3678        async fn internal_handle_kickoff(
3679            &self,
3680            request: tonic::Request<super::Txid>,
3681        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
3682        /// Returns the current status of tasks running on the verifier and their last synced heights.
3683        async fn get_current_status(
3684            &self,
3685            request: tonic::Request<super::Empty>,
3686        ) -> std::result::Result<tonic::Response<super::EntityStatus>, tonic::Status>;
3687        /// 1. Signs all tx's it can according to given transaction type (use it with AllNeededForDeposit to get almost all tx's)
3688        /// 2. Creates the transactions denoted by the deposit and operator_idx, round_idx, and kickoff_idx.
3689        /// 3. It will create the transaction and sign it with the operator's private key and/or saved nofn signatures.
3690        ///
3691        /// # Parameters
3692        /// - deposit_params: User's deposit information
3693        /// - transaction_type: Requested Transaction type
3694        /// - kickoff_id: Operator's kickoff ID
3695        ///
3696        /// # Returns
3697        /// - Raw signed transactions that the entity can sign (no asserts and watchtower challenge)
3698        async fn internal_create_signed_txs(
3699            &self,
3700            request: tonic::Request<super::TransactionRequest>,
3701        ) -> std::result::Result<
3702            tonic::Response<super::SignedTxsWithType>,
3703            tonic::Status,
3704        >;
3705        /// Signs the verifiers own watchtower challenge tx in the corresponding
3706        /// kickoff and returns the signed raw tx
3707        async fn internal_create_watchtower_challenge(
3708            &self,
3709            request: tonic::Request<super::TransactionRequest>,
3710        ) -> std::result::Result<
3711            tonic::Response<super::RawTxWithRbfInfo>,
3712            tonic::Status,
3713        >;
3714        async fn vergen(
3715            &self,
3716            request: tonic::Request<super::Empty>,
3717        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status>;
3718    }
3719    #[derive(Debug)]
3720    pub struct ClementineVerifierServer<T> {
3721        inner: Arc<T>,
3722        accept_compression_encodings: EnabledCompressionEncodings,
3723        send_compression_encodings: EnabledCompressionEncodings,
3724        max_decoding_message_size: Option<usize>,
3725        max_encoding_message_size: Option<usize>,
3726    }
3727    impl<T> ClementineVerifierServer<T> {
3728        pub fn new(inner: T) -> Self {
3729            Self::from_arc(Arc::new(inner))
3730        }
3731        pub fn from_arc(inner: Arc<T>) -> Self {
3732            Self {
3733                inner,
3734                accept_compression_encodings: Default::default(),
3735                send_compression_encodings: Default::default(),
3736                max_decoding_message_size: None,
3737                max_encoding_message_size: None,
3738            }
3739        }
3740        pub fn with_interceptor<F>(
3741            inner: T,
3742            interceptor: F,
3743        ) -> InterceptedService<Self, F>
3744        where
3745            F: tonic::service::Interceptor,
3746        {
3747            InterceptedService::new(Self::new(inner), interceptor)
3748        }
3749        /// Enable decompressing requests with the given encoding.
3750        #[must_use]
3751        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3752            self.accept_compression_encodings.enable(encoding);
3753            self
3754        }
3755        /// Compress responses with the given encoding, if the client supports it.
3756        #[must_use]
3757        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3758            self.send_compression_encodings.enable(encoding);
3759            self
3760        }
3761        /// Limits the maximum size of a decoded message.
3762        ///
3763        /// Default: `4MB`
3764        #[must_use]
3765        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3766            self.max_decoding_message_size = Some(limit);
3767            self
3768        }
3769        /// Limits the maximum size of an encoded message.
3770        ///
3771        /// Default: `usize::MAX`
3772        #[must_use]
3773        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3774            self.max_encoding_message_size = Some(limit);
3775            self
3776        }
3777    }
3778    impl<T, B> tonic::codegen::Service<http::Request<B>> for ClementineVerifierServer<T>
3779    where
3780        T: ClementineVerifier,
3781        B: Body + std::marker::Send + 'static,
3782        B::Error: Into<StdError> + std::marker::Send + 'static,
3783    {
3784        type Response = http::Response<tonic::body::BoxBody>;
3785        type Error = std::convert::Infallible;
3786        type Future = BoxFuture<Self::Response, Self::Error>;
3787        fn poll_ready(
3788            &mut self,
3789            _cx: &mut Context<'_>,
3790        ) -> Poll<std::result::Result<(), Self::Error>> {
3791            Poll::Ready(Ok(()))
3792        }
3793        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3794            match req.uri().path() {
3795                "/clementine.ClementineVerifier/GetParams" => {
3796                    #[allow(non_camel_case_types)]
3797                    struct GetParamsSvc<T: ClementineVerifier>(pub Arc<T>);
3798                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Empty>
3799                    for GetParamsSvc<T> {
3800                        type Response = super::VerifierParams;
3801                        type Future = BoxFuture<
3802                            tonic::Response<Self::Response>,
3803                            tonic::Status,
3804                        >;
3805                        fn call(
3806                            &mut self,
3807                            request: tonic::Request<super::Empty>,
3808                        ) -> Self::Future {
3809                            let inner = Arc::clone(&self.0);
3810                            let fut = async move {
3811                                <T as ClementineVerifier>::get_params(&inner, request).await
3812                            };
3813                            Box::pin(fut)
3814                        }
3815                    }
3816                    let accept_compression_encodings = self.accept_compression_encodings;
3817                    let send_compression_encodings = self.send_compression_encodings;
3818                    let max_decoding_message_size = self.max_decoding_message_size;
3819                    let max_encoding_message_size = self.max_encoding_message_size;
3820                    let inner = self.inner.clone();
3821                    let fut = async move {
3822                        let method = GetParamsSvc(inner);
3823                        let codec = tonic::codec::ProstCodec::default();
3824                        let mut grpc = tonic::server::Grpc::new(codec)
3825                            .apply_compression_config(
3826                                accept_compression_encodings,
3827                                send_compression_encodings,
3828                            )
3829                            .apply_max_message_size_config(
3830                                max_decoding_message_size,
3831                                max_encoding_message_size,
3832                            );
3833                        let res = grpc.unary(method, req).await;
3834                        Ok(res)
3835                    };
3836                    Box::pin(fut)
3837                }
3838                "/clementine.ClementineVerifier/GetCompatibilityParams" => {
3839                    #[allow(non_camel_case_types)]
3840                    struct GetCompatibilityParamsSvc<T: ClementineVerifier>(pub Arc<T>);
3841                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Empty>
3842                    for GetCompatibilityParamsSvc<T> {
3843                        type Response = super::CompatibilityParamsRpc;
3844                        type Future = BoxFuture<
3845                            tonic::Response<Self::Response>,
3846                            tonic::Status,
3847                        >;
3848                        fn call(
3849                            &mut self,
3850                            request: tonic::Request<super::Empty>,
3851                        ) -> Self::Future {
3852                            let inner = Arc::clone(&self.0);
3853                            let fut = async move {
3854                                <T as ClementineVerifier>::get_compatibility_params(
3855                                        &inner,
3856                                        request,
3857                                    )
3858                                    .await
3859                            };
3860                            Box::pin(fut)
3861                        }
3862                    }
3863                    let accept_compression_encodings = self.accept_compression_encodings;
3864                    let send_compression_encodings = self.send_compression_encodings;
3865                    let max_decoding_message_size = self.max_decoding_message_size;
3866                    let max_encoding_message_size = self.max_encoding_message_size;
3867                    let inner = self.inner.clone();
3868                    let fut = async move {
3869                        let method = GetCompatibilityParamsSvc(inner);
3870                        let codec = tonic::codec::ProstCodec::default();
3871                        let mut grpc = tonic::server::Grpc::new(codec)
3872                            .apply_compression_config(
3873                                accept_compression_encodings,
3874                                send_compression_encodings,
3875                            )
3876                            .apply_max_message_size_config(
3877                                max_decoding_message_size,
3878                                max_encoding_message_size,
3879                            );
3880                        let res = grpc.unary(method, req).await;
3881                        Ok(res)
3882                    };
3883                    Box::pin(fut)
3884                }
3885                "/clementine.ClementineVerifier/SetOperator" => {
3886                    #[allow(non_camel_case_types)]
3887                    struct SetOperatorSvc<T: ClementineVerifier>(pub Arc<T>);
3888                    impl<
3889                        T: ClementineVerifier,
3890                    > tonic::server::ClientStreamingService<super::OperatorParams>
3891                    for SetOperatorSvc<T> {
3892                        type Response = super::Empty;
3893                        type Future = BoxFuture<
3894                            tonic::Response<Self::Response>,
3895                            tonic::Status,
3896                        >;
3897                        fn call(
3898                            &mut self,
3899                            request: tonic::Request<
3900                                tonic::Streaming<super::OperatorParams>,
3901                            >,
3902                        ) -> Self::Future {
3903                            let inner = Arc::clone(&self.0);
3904                            let fut = async move {
3905                                <T as ClementineVerifier>::set_operator(&inner, request)
3906                                    .await
3907                            };
3908                            Box::pin(fut)
3909                        }
3910                    }
3911                    let accept_compression_encodings = self.accept_compression_encodings;
3912                    let send_compression_encodings = self.send_compression_encodings;
3913                    let max_decoding_message_size = self.max_decoding_message_size;
3914                    let max_encoding_message_size = self.max_encoding_message_size;
3915                    let inner = self.inner.clone();
3916                    let fut = async move {
3917                        let method = SetOperatorSvc(inner);
3918                        let codec = tonic::codec::ProstCodec::default();
3919                        let mut grpc = tonic::server::Grpc::new(codec)
3920                            .apply_compression_config(
3921                                accept_compression_encodings,
3922                                send_compression_encodings,
3923                            )
3924                            .apply_max_message_size_config(
3925                                max_decoding_message_size,
3926                                max_encoding_message_size,
3927                            );
3928                        let res = grpc.client_streaming(method, req).await;
3929                        Ok(res)
3930                    };
3931                    Box::pin(fut)
3932                }
3933                "/clementine.ClementineVerifier/SetOperatorKeys" => {
3934                    #[allow(non_camel_case_types)]
3935                    struct SetOperatorKeysSvc<T: ClementineVerifier>(pub Arc<T>);
3936                    impl<
3937                        T: ClementineVerifier,
3938                    > tonic::server::UnaryService<super::OperatorKeysWithDeposit>
3939                    for SetOperatorKeysSvc<T> {
3940                        type Response = super::Empty;
3941                        type Future = BoxFuture<
3942                            tonic::Response<Self::Response>,
3943                            tonic::Status,
3944                        >;
3945                        fn call(
3946                            &mut self,
3947                            request: tonic::Request<super::OperatorKeysWithDeposit>,
3948                        ) -> Self::Future {
3949                            let inner = Arc::clone(&self.0);
3950                            let fut = async move {
3951                                <T as ClementineVerifier>::set_operator_keys(
3952                                        &inner,
3953                                        request,
3954                                    )
3955                                    .await
3956                            };
3957                            Box::pin(fut)
3958                        }
3959                    }
3960                    let accept_compression_encodings = self.accept_compression_encodings;
3961                    let send_compression_encodings = self.send_compression_encodings;
3962                    let max_decoding_message_size = self.max_decoding_message_size;
3963                    let max_encoding_message_size = self.max_encoding_message_size;
3964                    let inner = self.inner.clone();
3965                    let fut = async move {
3966                        let method = SetOperatorKeysSvc(inner);
3967                        let codec = tonic::codec::ProstCodec::default();
3968                        let mut grpc = tonic::server::Grpc::new(codec)
3969                            .apply_compression_config(
3970                                accept_compression_encodings,
3971                                send_compression_encodings,
3972                            )
3973                            .apply_max_message_size_config(
3974                                max_decoding_message_size,
3975                                max_encoding_message_size,
3976                            );
3977                        let res = grpc.unary(method, req).await;
3978                        Ok(res)
3979                    };
3980                    Box::pin(fut)
3981                }
3982                "/clementine.ClementineVerifier/NonceGen" => {
3983                    #[allow(non_camel_case_types)]
3984                    struct NonceGenSvc<T: ClementineVerifier>(pub Arc<T>);
3985                    impl<
3986                        T: ClementineVerifier,
3987                    > tonic::server::ServerStreamingService<super::NonceGenRequest>
3988                    for NonceGenSvc<T> {
3989                        type Response = super::NonceGenResponse;
3990                        type ResponseStream = T::NonceGenStream;
3991                        type Future = BoxFuture<
3992                            tonic::Response<Self::ResponseStream>,
3993                            tonic::Status,
3994                        >;
3995                        fn call(
3996                            &mut self,
3997                            request: tonic::Request<super::NonceGenRequest>,
3998                        ) -> Self::Future {
3999                            let inner = Arc::clone(&self.0);
4000                            let fut = async move {
4001                                <T as ClementineVerifier>::nonce_gen(&inner, request).await
4002                            };
4003                            Box::pin(fut)
4004                        }
4005                    }
4006                    let accept_compression_encodings = self.accept_compression_encodings;
4007                    let send_compression_encodings = self.send_compression_encodings;
4008                    let max_decoding_message_size = self.max_decoding_message_size;
4009                    let max_encoding_message_size = self.max_encoding_message_size;
4010                    let inner = self.inner.clone();
4011                    let fut = async move {
4012                        let method = NonceGenSvc(inner);
4013                        let codec = tonic::codec::ProstCodec::default();
4014                        let mut grpc = tonic::server::Grpc::new(codec)
4015                            .apply_compression_config(
4016                                accept_compression_encodings,
4017                                send_compression_encodings,
4018                            )
4019                            .apply_max_message_size_config(
4020                                max_decoding_message_size,
4021                                max_encoding_message_size,
4022                            );
4023                        let res = grpc.server_streaming(method, req).await;
4024                        Ok(res)
4025                    };
4026                    Box::pin(fut)
4027                }
4028                "/clementine.ClementineVerifier/DepositSign" => {
4029                    #[allow(non_camel_case_types)]
4030                    struct DepositSignSvc<T: ClementineVerifier>(pub Arc<T>);
4031                    impl<
4032                        T: ClementineVerifier,
4033                    > tonic::server::StreamingService<super::VerifierDepositSignParams>
4034                    for DepositSignSvc<T> {
4035                        type Response = super::PartialSig;
4036                        type ResponseStream = T::DepositSignStream;
4037                        type Future = BoxFuture<
4038                            tonic::Response<Self::ResponseStream>,
4039                            tonic::Status,
4040                        >;
4041                        fn call(
4042                            &mut self,
4043                            request: tonic::Request<
4044                                tonic::Streaming<super::VerifierDepositSignParams>,
4045                            >,
4046                        ) -> Self::Future {
4047                            let inner = Arc::clone(&self.0);
4048                            let fut = async move {
4049                                <T as ClementineVerifier>::deposit_sign(&inner, request)
4050                                    .await
4051                            };
4052                            Box::pin(fut)
4053                        }
4054                    }
4055                    let accept_compression_encodings = self.accept_compression_encodings;
4056                    let send_compression_encodings = self.send_compression_encodings;
4057                    let max_decoding_message_size = self.max_decoding_message_size;
4058                    let max_encoding_message_size = self.max_encoding_message_size;
4059                    let inner = self.inner.clone();
4060                    let fut = async move {
4061                        let method = DepositSignSvc(inner);
4062                        let codec = tonic::codec::ProstCodec::default();
4063                        let mut grpc = tonic::server::Grpc::new(codec)
4064                            .apply_compression_config(
4065                                accept_compression_encodings,
4066                                send_compression_encodings,
4067                            )
4068                            .apply_max_message_size_config(
4069                                max_decoding_message_size,
4070                                max_encoding_message_size,
4071                            );
4072                        let res = grpc.streaming(method, req).await;
4073                        Ok(res)
4074                    };
4075                    Box::pin(fut)
4076                }
4077                "/clementine.ClementineVerifier/OptimisticPayoutSign" => {
4078                    #[allow(non_camel_case_types)]
4079                    struct OptimisticPayoutSignSvc<T: ClementineVerifier>(pub Arc<T>);
4080                    impl<
4081                        T: ClementineVerifier,
4082                    > tonic::server::UnaryService<super::OptimisticPayoutParams>
4083                    for OptimisticPayoutSignSvc<T> {
4084                        type Response = super::PartialSig;
4085                        type Future = BoxFuture<
4086                            tonic::Response<Self::Response>,
4087                            tonic::Status,
4088                        >;
4089                        fn call(
4090                            &mut self,
4091                            request: tonic::Request<super::OptimisticPayoutParams>,
4092                        ) -> Self::Future {
4093                            let inner = Arc::clone(&self.0);
4094                            let fut = async move {
4095                                <T as ClementineVerifier>::optimistic_payout_sign(
4096                                        &inner,
4097                                        request,
4098                                    )
4099                                    .await
4100                            };
4101                            Box::pin(fut)
4102                        }
4103                    }
4104                    let accept_compression_encodings = self.accept_compression_encodings;
4105                    let send_compression_encodings = self.send_compression_encodings;
4106                    let max_decoding_message_size = self.max_decoding_message_size;
4107                    let max_encoding_message_size = self.max_encoding_message_size;
4108                    let inner = self.inner.clone();
4109                    let fut = async move {
4110                        let method = OptimisticPayoutSignSvc(inner);
4111                        let codec = tonic::codec::ProstCodec::default();
4112                        let mut grpc = tonic::server::Grpc::new(codec)
4113                            .apply_compression_config(
4114                                accept_compression_encodings,
4115                                send_compression_encodings,
4116                            )
4117                            .apply_max_message_size_config(
4118                                max_decoding_message_size,
4119                                max_encoding_message_size,
4120                            );
4121                        let res = grpc.unary(method, req).await;
4122                        Ok(res)
4123                    };
4124                    Box::pin(fut)
4125                }
4126                "/clementine.ClementineVerifier/DepositFinalize" => {
4127                    #[allow(non_camel_case_types)]
4128                    struct DepositFinalizeSvc<T: ClementineVerifier>(pub Arc<T>);
4129                    impl<
4130                        T: ClementineVerifier,
4131                    > tonic::server::ClientStreamingService<
4132                        super::VerifierDepositFinalizeParams,
4133                    > for DepositFinalizeSvc<T> {
4134                        type Response = super::VerifierDepositFinalizeResponse;
4135                        type Future = BoxFuture<
4136                            tonic::Response<Self::Response>,
4137                            tonic::Status,
4138                        >;
4139                        fn call(
4140                            &mut self,
4141                            request: tonic::Request<
4142                                tonic::Streaming<super::VerifierDepositFinalizeParams>,
4143                            >,
4144                        ) -> Self::Future {
4145                            let inner = Arc::clone(&self.0);
4146                            let fut = async move {
4147                                <T as ClementineVerifier>::deposit_finalize(&inner, request)
4148                                    .await
4149                            };
4150                            Box::pin(fut)
4151                        }
4152                    }
4153                    let accept_compression_encodings = self.accept_compression_encodings;
4154                    let send_compression_encodings = self.send_compression_encodings;
4155                    let max_decoding_message_size = self.max_decoding_message_size;
4156                    let max_encoding_message_size = self.max_encoding_message_size;
4157                    let inner = self.inner.clone();
4158                    let fut = async move {
4159                        let method = DepositFinalizeSvc(inner);
4160                        let codec = tonic::codec::ProstCodec::default();
4161                        let mut grpc = tonic::server::Grpc::new(codec)
4162                            .apply_compression_config(
4163                                accept_compression_encodings,
4164                                send_compression_encodings,
4165                            )
4166                            .apply_max_message_size_config(
4167                                max_decoding_message_size,
4168                                max_encoding_message_size,
4169                            );
4170                        let res = grpc.client_streaming(method, req).await;
4171                        Ok(res)
4172                    };
4173                    Box::pin(fut)
4174                }
4175                "/clementine.ClementineVerifier/DebugTx" => {
4176                    #[allow(non_camel_case_types)]
4177                    struct DebugTxSvc<T: ClementineVerifier>(pub Arc<T>);
4178                    impl<
4179                        T: ClementineVerifier,
4180                    > tonic::server::UnaryService<super::TxDebugRequest>
4181                    for DebugTxSvc<T> {
4182                        type Response = super::TxDebugInfo;
4183                        type Future = BoxFuture<
4184                            tonic::Response<Self::Response>,
4185                            tonic::Status,
4186                        >;
4187                        fn call(
4188                            &mut self,
4189                            request: tonic::Request<super::TxDebugRequest>,
4190                        ) -> Self::Future {
4191                            let inner = Arc::clone(&self.0);
4192                            let fut = async move {
4193                                <T as ClementineVerifier>::debug_tx(&inner, request).await
4194                            };
4195                            Box::pin(fut)
4196                        }
4197                    }
4198                    let accept_compression_encodings = self.accept_compression_encodings;
4199                    let send_compression_encodings = self.send_compression_encodings;
4200                    let max_decoding_message_size = self.max_decoding_message_size;
4201                    let max_encoding_message_size = self.max_encoding_message_size;
4202                    let inner = self.inner.clone();
4203                    let fut = async move {
4204                        let method = DebugTxSvc(inner);
4205                        let codec = tonic::codec::ProstCodec::default();
4206                        let mut grpc = tonic::server::Grpc::new(codec)
4207                            .apply_compression_config(
4208                                accept_compression_encodings,
4209                                send_compression_encodings,
4210                            )
4211                            .apply_max_message_size_config(
4212                                max_decoding_message_size,
4213                                max_encoding_message_size,
4214                            );
4215                        let res = grpc.unary(method, req).await;
4216                        Ok(res)
4217                    };
4218                    Box::pin(fut)
4219                }
4220                "/clementine.ClementineVerifier/RestartBackgroundTasks" => {
4221                    #[allow(non_camel_case_types)]
4222                    struct RestartBackgroundTasksSvc<T: ClementineVerifier>(pub Arc<T>);
4223                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Empty>
4224                    for RestartBackgroundTasksSvc<T> {
4225                        type Response = super::Empty;
4226                        type Future = BoxFuture<
4227                            tonic::Response<Self::Response>,
4228                            tonic::Status,
4229                        >;
4230                        fn call(
4231                            &mut self,
4232                            request: tonic::Request<super::Empty>,
4233                        ) -> Self::Future {
4234                            let inner = Arc::clone(&self.0);
4235                            let fut = async move {
4236                                <T as ClementineVerifier>::restart_background_tasks(
4237                                        &inner,
4238                                        request,
4239                                    )
4240                                    .await
4241                            };
4242                            Box::pin(fut)
4243                        }
4244                    }
4245                    let accept_compression_encodings = self.accept_compression_encodings;
4246                    let send_compression_encodings = self.send_compression_encodings;
4247                    let max_decoding_message_size = self.max_decoding_message_size;
4248                    let max_encoding_message_size = self.max_encoding_message_size;
4249                    let inner = self.inner.clone();
4250                    let fut = async move {
4251                        let method = RestartBackgroundTasksSvc(inner);
4252                        let codec = tonic::codec::ProstCodec::default();
4253                        let mut grpc = tonic::server::Grpc::new(codec)
4254                            .apply_compression_config(
4255                                accept_compression_encodings,
4256                                send_compression_encodings,
4257                            )
4258                            .apply_max_message_size_config(
4259                                max_decoding_message_size,
4260                                max_encoding_message_size,
4261                            );
4262                        let res = grpc.unary(method, req).await;
4263                        Ok(res)
4264                    };
4265                    Box::pin(fut)
4266                }
4267                "/clementine.ClementineVerifier/InternalHandleKickoff" => {
4268                    #[allow(non_camel_case_types)]
4269                    struct InternalHandleKickoffSvc<T: ClementineVerifier>(pub Arc<T>);
4270                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Txid>
4271                    for InternalHandleKickoffSvc<T> {
4272                        type Response = super::Empty;
4273                        type Future = BoxFuture<
4274                            tonic::Response<Self::Response>,
4275                            tonic::Status,
4276                        >;
4277                        fn call(
4278                            &mut self,
4279                            request: tonic::Request<super::Txid>,
4280                        ) -> Self::Future {
4281                            let inner = Arc::clone(&self.0);
4282                            let fut = async move {
4283                                <T as ClementineVerifier>::internal_handle_kickoff(
4284                                        &inner,
4285                                        request,
4286                                    )
4287                                    .await
4288                            };
4289                            Box::pin(fut)
4290                        }
4291                    }
4292                    let accept_compression_encodings = self.accept_compression_encodings;
4293                    let send_compression_encodings = self.send_compression_encodings;
4294                    let max_decoding_message_size = self.max_decoding_message_size;
4295                    let max_encoding_message_size = self.max_encoding_message_size;
4296                    let inner = self.inner.clone();
4297                    let fut = async move {
4298                        let method = InternalHandleKickoffSvc(inner);
4299                        let codec = tonic::codec::ProstCodec::default();
4300                        let mut grpc = tonic::server::Grpc::new(codec)
4301                            .apply_compression_config(
4302                                accept_compression_encodings,
4303                                send_compression_encodings,
4304                            )
4305                            .apply_max_message_size_config(
4306                                max_decoding_message_size,
4307                                max_encoding_message_size,
4308                            );
4309                        let res = grpc.unary(method, req).await;
4310                        Ok(res)
4311                    };
4312                    Box::pin(fut)
4313                }
4314                "/clementine.ClementineVerifier/GetCurrentStatus" => {
4315                    #[allow(non_camel_case_types)]
4316                    struct GetCurrentStatusSvc<T: ClementineVerifier>(pub Arc<T>);
4317                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Empty>
4318                    for GetCurrentStatusSvc<T> {
4319                        type Response = super::EntityStatus;
4320                        type Future = BoxFuture<
4321                            tonic::Response<Self::Response>,
4322                            tonic::Status,
4323                        >;
4324                        fn call(
4325                            &mut self,
4326                            request: tonic::Request<super::Empty>,
4327                        ) -> Self::Future {
4328                            let inner = Arc::clone(&self.0);
4329                            let fut = async move {
4330                                <T as ClementineVerifier>::get_current_status(
4331                                        &inner,
4332                                        request,
4333                                    )
4334                                    .await
4335                            };
4336                            Box::pin(fut)
4337                        }
4338                    }
4339                    let accept_compression_encodings = self.accept_compression_encodings;
4340                    let send_compression_encodings = self.send_compression_encodings;
4341                    let max_decoding_message_size = self.max_decoding_message_size;
4342                    let max_encoding_message_size = self.max_encoding_message_size;
4343                    let inner = self.inner.clone();
4344                    let fut = async move {
4345                        let method = GetCurrentStatusSvc(inner);
4346                        let codec = tonic::codec::ProstCodec::default();
4347                        let mut grpc = tonic::server::Grpc::new(codec)
4348                            .apply_compression_config(
4349                                accept_compression_encodings,
4350                                send_compression_encodings,
4351                            )
4352                            .apply_max_message_size_config(
4353                                max_decoding_message_size,
4354                                max_encoding_message_size,
4355                            );
4356                        let res = grpc.unary(method, req).await;
4357                        Ok(res)
4358                    };
4359                    Box::pin(fut)
4360                }
4361                "/clementine.ClementineVerifier/InternalCreateSignedTxs" => {
4362                    #[allow(non_camel_case_types)]
4363                    struct InternalCreateSignedTxsSvc<T: ClementineVerifier>(pub Arc<T>);
4364                    impl<
4365                        T: ClementineVerifier,
4366                    > tonic::server::UnaryService<super::TransactionRequest>
4367                    for InternalCreateSignedTxsSvc<T> {
4368                        type Response = super::SignedTxsWithType;
4369                        type Future = BoxFuture<
4370                            tonic::Response<Self::Response>,
4371                            tonic::Status,
4372                        >;
4373                        fn call(
4374                            &mut self,
4375                            request: tonic::Request<super::TransactionRequest>,
4376                        ) -> Self::Future {
4377                            let inner = Arc::clone(&self.0);
4378                            let fut = async move {
4379                                <T as ClementineVerifier>::internal_create_signed_txs(
4380                                        &inner,
4381                                        request,
4382                                    )
4383                                    .await
4384                            };
4385                            Box::pin(fut)
4386                        }
4387                    }
4388                    let accept_compression_encodings = self.accept_compression_encodings;
4389                    let send_compression_encodings = self.send_compression_encodings;
4390                    let max_decoding_message_size = self.max_decoding_message_size;
4391                    let max_encoding_message_size = self.max_encoding_message_size;
4392                    let inner = self.inner.clone();
4393                    let fut = async move {
4394                        let method = InternalCreateSignedTxsSvc(inner);
4395                        let codec = tonic::codec::ProstCodec::default();
4396                        let mut grpc = tonic::server::Grpc::new(codec)
4397                            .apply_compression_config(
4398                                accept_compression_encodings,
4399                                send_compression_encodings,
4400                            )
4401                            .apply_max_message_size_config(
4402                                max_decoding_message_size,
4403                                max_encoding_message_size,
4404                            );
4405                        let res = grpc.unary(method, req).await;
4406                        Ok(res)
4407                    };
4408                    Box::pin(fut)
4409                }
4410                "/clementine.ClementineVerifier/InternalCreateWatchtowerChallenge" => {
4411                    #[allow(non_camel_case_types)]
4412                    struct InternalCreateWatchtowerChallengeSvc<T: ClementineVerifier>(
4413                        pub Arc<T>,
4414                    );
4415                    impl<
4416                        T: ClementineVerifier,
4417                    > tonic::server::UnaryService<super::TransactionRequest>
4418                    for InternalCreateWatchtowerChallengeSvc<T> {
4419                        type Response = super::RawTxWithRbfInfo;
4420                        type Future = BoxFuture<
4421                            tonic::Response<Self::Response>,
4422                            tonic::Status,
4423                        >;
4424                        fn call(
4425                            &mut self,
4426                            request: tonic::Request<super::TransactionRequest>,
4427                        ) -> Self::Future {
4428                            let inner = Arc::clone(&self.0);
4429                            let fut = async move {
4430                                <T as ClementineVerifier>::internal_create_watchtower_challenge(
4431                                        &inner,
4432                                        request,
4433                                    )
4434                                    .await
4435                            };
4436                            Box::pin(fut)
4437                        }
4438                    }
4439                    let accept_compression_encodings = self.accept_compression_encodings;
4440                    let send_compression_encodings = self.send_compression_encodings;
4441                    let max_decoding_message_size = self.max_decoding_message_size;
4442                    let max_encoding_message_size = self.max_encoding_message_size;
4443                    let inner = self.inner.clone();
4444                    let fut = async move {
4445                        let method = InternalCreateWatchtowerChallengeSvc(inner);
4446                        let codec = tonic::codec::ProstCodec::default();
4447                        let mut grpc = tonic::server::Grpc::new(codec)
4448                            .apply_compression_config(
4449                                accept_compression_encodings,
4450                                send_compression_encodings,
4451                            )
4452                            .apply_max_message_size_config(
4453                                max_decoding_message_size,
4454                                max_encoding_message_size,
4455                            );
4456                        let res = grpc.unary(method, req).await;
4457                        Ok(res)
4458                    };
4459                    Box::pin(fut)
4460                }
4461                "/clementine.ClementineVerifier/Vergen" => {
4462                    #[allow(non_camel_case_types)]
4463                    struct VergenSvc<T: ClementineVerifier>(pub Arc<T>);
4464                    impl<T: ClementineVerifier> tonic::server::UnaryService<super::Empty>
4465                    for VergenSvc<T> {
4466                        type Response = super::VergenResponse;
4467                        type Future = BoxFuture<
4468                            tonic::Response<Self::Response>,
4469                            tonic::Status,
4470                        >;
4471                        fn call(
4472                            &mut self,
4473                            request: tonic::Request<super::Empty>,
4474                        ) -> Self::Future {
4475                            let inner = Arc::clone(&self.0);
4476                            let fut = async move {
4477                                <T as ClementineVerifier>::vergen(&inner, request).await
4478                            };
4479                            Box::pin(fut)
4480                        }
4481                    }
4482                    let accept_compression_encodings = self.accept_compression_encodings;
4483                    let send_compression_encodings = self.send_compression_encodings;
4484                    let max_decoding_message_size = self.max_decoding_message_size;
4485                    let max_encoding_message_size = self.max_encoding_message_size;
4486                    let inner = self.inner.clone();
4487                    let fut = async move {
4488                        let method = VergenSvc(inner);
4489                        let codec = tonic::codec::ProstCodec::default();
4490                        let mut grpc = tonic::server::Grpc::new(codec)
4491                            .apply_compression_config(
4492                                accept_compression_encodings,
4493                                send_compression_encodings,
4494                            )
4495                            .apply_max_message_size_config(
4496                                max_decoding_message_size,
4497                                max_encoding_message_size,
4498                            );
4499                        let res = grpc.unary(method, req).await;
4500                        Ok(res)
4501                    };
4502                    Box::pin(fut)
4503                }
4504                _ => {
4505                    Box::pin(async move {
4506                        let mut response = http::Response::new(empty_body());
4507                        let headers = response.headers_mut();
4508                        headers
4509                            .insert(
4510                                tonic::Status::GRPC_STATUS,
4511                                (tonic::Code::Unimplemented as i32).into(),
4512                            );
4513                        headers
4514                            .insert(
4515                                http::header::CONTENT_TYPE,
4516                                tonic::metadata::GRPC_CONTENT_TYPE,
4517                            );
4518                        Ok(response)
4519                    })
4520                }
4521            }
4522        }
4523    }
4524    impl<T> Clone for ClementineVerifierServer<T> {
4525        fn clone(&self) -> Self {
4526            let inner = self.inner.clone();
4527            Self {
4528                inner,
4529                accept_compression_encodings: self.accept_compression_encodings,
4530                send_compression_encodings: self.send_compression_encodings,
4531                max_decoding_message_size: self.max_decoding_message_size,
4532                max_encoding_message_size: self.max_encoding_message_size,
4533            }
4534        }
4535    }
4536    /// Generated gRPC service name
4537    pub const SERVICE_NAME: &str = "clementine.ClementineVerifier";
4538    impl<T> tonic::server::NamedService for ClementineVerifierServer<T> {
4539        const NAME: &'static str = SERVICE_NAME;
4540    }
4541}
4542/// Generated server implementations.
4543pub mod clementine_aggregator_server {
4544    #![allow(
4545        unused_variables,
4546        dead_code,
4547        missing_docs,
4548        clippy::wildcard_imports,
4549        clippy::let_unit_value,
4550    )]
4551    use tonic::codegen::*;
4552    /// Generated trait containing gRPC methods that should be implemented for use with ClementineAggregatorServer.
4553    #[async_trait]
4554    pub trait ClementineAggregator: std::marker::Send + std::marker::Sync + 'static {
4555        async fn get_nofn_aggregated_xonly_pk(
4556            &self,
4557            request: tonic::Request<super::Empty>,
4558        ) -> std::result::Result<tonic::Response<super::NofnResponse>, tonic::Status>;
4559        /// Returns the compatibility data from all entities
4560        async fn get_compatibility_data_from_entities(
4561            &self,
4562            request: tonic::Request<super::Empty>,
4563        ) -> std::result::Result<
4564            tonic::Response<super::EntitiesCompatibilityData>,
4565            tonic::Status,
4566        >;
4567        /// Returns the protocol params that can affect the transactions in the contract, syncing with citrea and version number
4568        /// for checking compatibility
4569        async fn get_compatibility_params(
4570            &self,
4571            request: tonic::Request<super::Empty>,
4572        ) -> std::result::Result<
4573            tonic::Response<super::CompatibilityParamsRpc>,
4574            tonic::Status,
4575        >;
4576        /// Sets up the system of verifiers, watchtowers and operators by:
4577        ///
4578        /// 1. Collects verifier keys from each verifier
4579        /// 2. Distributes these verifier keys to all verifiers
4580        /// 3. Collects all operator configs from each operator
4581        /// 4. Distributes these operator configs to all verifiers
4582        ///
4583        /// Used by the clementine-backend service
4584        async fn setup(
4585            &self,
4586            request: tonic::Request<super::Empty>,
4587        ) -> std::result::Result<
4588            tonic::Response<super::VerifierPublicKeys>,
4589            tonic::Status,
4590        >;
4591        /// This will call, DepositNonceGen for every verifier,
4592        /// then it will aggregate one by one and then send it to DepositSign,
4593        /// then it will aggregate the partial sigs and send it to DepositFinalize,
4594        /// this will also call the operator to get their signatures and send it to
4595        /// DepositFinalize then it will collect the partial sigs and create the move
4596        /// tx.
4597        ///
4598        /// Used by the clementine-backend service to initiate a deposit
4599        async fn new_deposit(
4600            &self,
4601            request: tonic::Request<super::Deposit>,
4602        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status>;
4603        /// Call's withdraw on all operators
4604        /// Used by the clementine-backend service to initiate a withdrawal
4605        /// If the operator's xonly public keys list is empty, the withdrawal will be sent to all operators.
4606        /// If not, only the operators in the list will be sent the withdrawal request.
4607        async fn withdraw(
4608            &self,
4609            request: tonic::Request<super::AggregatorWithdrawalInput>,
4610        ) -> std::result::Result<
4611            tonic::Response<super::AggregatorWithdrawResponse>,
4612            tonic::Status,
4613        >;
4614        /// Perform an optimistic payout to reimburse a peg-out from Citrea
4615        async fn optimistic_payout(
4616            &self,
4617            request: tonic::Request<super::OptimisticWithdrawParams>,
4618        ) -> std::result::Result<tonic::Response<super::RawSignedTx>, tonic::Status>;
4619        /// Send a pre-signed tx to the network
4620        async fn internal_send_tx(
4621            &self,
4622            request: tonic::Request<super::SendTxRequest>,
4623        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
4624        async fn send_move_to_vault_tx(
4625            &self,
4626            request: tonic::Request<super::SendMoveTxRequest>,
4627        ) -> std::result::Result<tonic::Response<super::Txid>, tonic::Status>;
4628        /// Returns the current status of tasks running on the operators/verifiers.
4629        /// If restart_tasks is true, it will restart the tasks on the entities if they are stopped.
4630        async fn get_entity_statuses(
4631            &self,
4632            request: tonic::Request<super::GetEntityStatusesRequest>,
4633        ) -> std::result::Result<tonic::Response<super::EntityStatuses>, tonic::Status>;
4634        /// Creates an emergency stop tx that won't be broadcasted.
4635        /// Tx will have around 3 sats/vbyte fee.
4636        /// Set add_anchor to true to add an anchor output for cpfp..
4637        async fn internal_get_emergency_stop_tx(
4638            &self,
4639            request: tonic::Request<super::GetEmergencyStopTxRequest>,
4640        ) -> std::result::Result<
4641            tonic::Response<super::GetEmergencyStopTxResponse>,
4642            tonic::Status,
4643        >;
4644        async fn vergen(
4645            &self,
4646            request: tonic::Request<super::Empty>,
4647        ) -> std::result::Result<tonic::Response<super::VergenResponse>, tonic::Status>;
4648    }
4649    #[derive(Debug)]
4650    pub struct ClementineAggregatorServer<T> {
4651        inner: Arc<T>,
4652        accept_compression_encodings: EnabledCompressionEncodings,
4653        send_compression_encodings: EnabledCompressionEncodings,
4654        max_decoding_message_size: Option<usize>,
4655        max_encoding_message_size: Option<usize>,
4656    }
4657    impl<T> ClementineAggregatorServer<T> {
4658        pub fn new(inner: T) -> Self {
4659            Self::from_arc(Arc::new(inner))
4660        }
4661        pub fn from_arc(inner: Arc<T>) -> Self {
4662            Self {
4663                inner,
4664                accept_compression_encodings: Default::default(),
4665                send_compression_encodings: Default::default(),
4666                max_decoding_message_size: None,
4667                max_encoding_message_size: None,
4668            }
4669        }
4670        pub fn with_interceptor<F>(
4671            inner: T,
4672            interceptor: F,
4673        ) -> InterceptedService<Self, F>
4674        where
4675            F: tonic::service::Interceptor,
4676        {
4677            InterceptedService::new(Self::new(inner), interceptor)
4678        }
4679        /// Enable decompressing requests with the given encoding.
4680        #[must_use]
4681        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4682            self.accept_compression_encodings.enable(encoding);
4683            self
4684        }
4685        /// Compress responses with the given encoding, if the client supports it.
4686        #[must_use]
4687        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4688            self.send_compression_encodings.enable(encoding);
4689            self
4690        }
4691        /// Limits the maximum size of a decoded message.
4692        ///
4693        /// Default: `4MB`
4694        #[must_use]
4695        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4696            self.max_decoding_message_size = Some(limit);
4697            self
4698        }
4699        /// Limits the maximum size of an encoded message.
4700        ///
4701        /// Default: `usize::MAX`
4702        #[must_use]
4703        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4704            self.max_encoding_message_size = Some(limit);
4705            self
4706        }
4707    }
4708    impl<T, B> tonic::codegen::Service<http::Request<B>>
4709    for ClementineAggregatorServer<T>
4710    where
4711        T: ClementineAggregator,
4712        B: Body + std::marker::Send + 'static,
4713        B::Error: Into<StdError> + std::marker::Send + 'static,
4714    {
4715        type Response = http::Response<tonic::body::BoxBody>;
4716        type Error = std::convert::Infallible;
4717        type Future = BoxFuture<Self::Response, Self::Error>;
4718        fn poll_ready(
4719            &mut self,
4720            _cx: &mut Context<'_>,
4721        ) -> Poll<std::result::Result<(), Self::Error>> {
4722            Poll::Ready(Ok(()))
4723        }
4724        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4725            match req.uri().path() {
4726                "/clementine.ClementineAggregator/GetNofnAggregatedXonlyPk" => {
4727                    #[allow(non_camel_case_types)]
4728                    struct GetNofnAggregatedXonlyPkSvc<T: ClementineAggregator>(
4729                        pub Arc<T>,
4730                    );
4731                    impl<
4732                        T: ClementineAggregator,
4733                    > tonic::server::UnaryService<super::Empty>
4734                    for GetNofnAggregatedXonlyPkSvc<T> {
4735                        type Response = super::NofnResponse;
4736                        type Future = BoxFuture<
4737                            tonic::Response<Self::Response>,
4738                            tonic::Status,
4739                        >;
4740                        fn call(
4741                            &mut self,
4742                            request: tonic::Request<super::Empty>,
4743                        ) -> Self::Future {
4744                            let inner = Arc::clone(&self.0);
4745                            let fut = async move {
4746                                <T as ClementineAggregator>::get_nofn_aggregated_xonly_pk(
4747                                        &inner,
4748                                        request,
4749                                    )
4750                                    .await
4751                            };
4752                            Box::pin(fut)
4753                        }
4754                    }
4755                    let accept_compression_encodings = self.accept_compression_encodings;
4756                    let send_compression_encodings = self.send_compression_encodings;
4757                    let max_decoding_message_size = self.max_decoding_message_size;
4758                    let max_encoding_message_size = self.max_encoding_message_size;
4759                    let inner = self.inner.clone();
4760                    let fut = async move {
4761                        let method = GetNofnAggregatedXonlyPkSvc(inner);
4762                        let codec = tonic::codec::ProstCodec::default();
4763                        let mut grpc = tonic::server::Grpc::new(codec)
4764                            .apply_compression_config(
4765                                accept_compression_encodings,
4766                                send_compression_encodings,
4767                            )
4768                            .apply_max_message_size_config(
4769                                max_decoding_message_size,
4770                                max_encoding_message_size,
4771                            );
4772                        let res = grpc.unary(method, req).await;
4773                        Ok(res)
4774                    };
4775                    Box::pin(fut)
4776                }
4777                "/clementine.ClementineAggregator/GetCompatibilityDataFromEntities" => {
4778                    #[allow(non_camel_case_types)]
4779                    struct GetCompatibilityDataFromEntitiesSvc<T: ClementineAggregator>(
4780                        pub Arc<T>,
4781                    );
4782                    impl<
4783                        T: ClementineAggregator,
4784                    > tonic::server::UnaryService<super::Empty>
4785                    for GetCompatibilityDataFromEntitiesSvc<T> {
4786                        type Response = super::EntitiesCompatibilityData;
4787                        type Future = BoxFuture<
4788                            tonic::Response<Self::Response>,
4789                            tonic::Status,
4790                        >;
4791                        fn call(
4792                            &mut self,
4793                            request: tonic::Request<super::Empty>,
4794                        ) -> Self::Future {
4795                            let inner = Arc::clone(&self.0);
4796                            let fut = async move {
4797                                <T as ClementineAggregator>::get_compatibility_data_from_entities(
4798                                        &inner,
4799                                        request,
4800                                    )
4801                                    .await
4802                            };
4803                            Box::pin(fut)
4804                        }
4805                    }
4806                    let accept_compression_encodings = self.accept_compression_encodings;
4807                    let send_compression_encodings = self.send_compression_encodings;
4808                    let max_decoding_message_size = self.max_decoding_message_size;
4809                    let max_encoding_message_size = self.max_encoding_message_size;
4810                    let inner = self.inner.clone();
4811                    let fut = async move {
4812                        let method = GetCompatibilityDataFromEntitiesSvc(inner);
4813                        let codec = tonic::codec::ProstCodec::default();
4814                        let mut grpc = tonic::server::Grpc::new(codec)
4815                            .apply_compression_config(
4816                                accept_compression_encodings,
4817                                send_compression_encodings,
4818                            )
4819                            .apply_max_message_size_config(
4820                                max_decoding_message_size,
4821                                max_encoding_message_size,
4822                            );
4823                        let res = grpc.unary(method, req).await;
4824                        Ok(res)
4825                    };
4826                    Box::pin(fut)
4827                }
4828                "/clementine.ClementineAggregator/GetCompatibilityParams" => {
4829                    #[allow(non_camel_case_types)]
4830                    struct GetCompatibilityParamsSvc<T: ClementineAggregator>(
4831                        pub Arc<T>,
4832                    );
4833                    impl<
4834                        T: ClementineAggregator,
4835                    > tonic::server::UnaryService<super::Empty>
4836                    for GetCompatibilityParamsSvc<T> {
4837                        type Response = super::CompatibilityParamsRpc;
4838                        type Future = BoxFuture<
4839                            tonic::Response<Self::Response>,
4840                            tonic::Status,
4841                        >;
4842                        fn call(
4843                            &mut self,
4844                            request: tonic::Request<super::Empty>,
4845                        ) -> Self::Future {
4846                            let inner = Arc::clone(&self.0);
4847                            let fut = async move {
4848                                <T as ClementineAggregator>::get_compatibility_params(
4849                                        &inner,
4850                                        request,
4851                                    )
4852                                    .await
4853                            };
4854                            Box::pin(fut)
4855                        }
4856                    }
4857                    let accept_compression_encodings = self.accept_compression_encodings;
4858                    let send_compression_encodings = self.send_compression_encodings;
4859                    let max_decoding_message_size = self.max_decoding_message_size;
4860                    let max_encoding_message_size = self.max_encoding_message_size;
4861                    let inner = self.inner.clone();
4862                    let fut = async move {
4863                        let method = GetCompatibilityParamsSvc(inner);
4864                        let codec = tonic::codec::ProstCodec::default();
4865                        let mut grpc = tonic::server::Grpc::new(codec)
4866                            .apply_compression_config(
4867                                accept_compression_encodings,
4868                                send_compression_encodings,
4869                            )
4870                            .apply_max_message_size_config(
4871                                max_decoding_message_size,
4872                                max_encoding_message_size,
4873                            );
4874                        let res = grpc.unary(method, req).await;
4875                        Ok(res)
4876                    };
4877                    Box::pin(fut)
4878                }
4879                "/clementine.ClementineAggregator/Setup" => {
4880                    #[allow(non_camel_case_types)]
4881                    struct SetupSvc<T: ClementineAggregator>(pub Arc<T>);
4882                    impl<
4883                        T: ClementineAggregator,
4884                    > tonic::server::UnaryService<super::Empty> for SetupSvc<T> {
4885                        type Response = super::VerifierPublicKeys;
4886                        type Future = BoxFuture<
4887                            tonic::Response<Self::Response>,
4888                            tonic::Status,
4889                        >;
4890                        fn call(
4891                            &mut self,
4892                            request: tonic::Request<super::Empty>,
4893                        ) -> Self::Future {
4894                            let inner = Arc::clone(&self.0);
4895                            let fut = async move {
4896                                <T as ClementineAggregator>::setup(&inner, request).await
4897                            };
4898                            Box::pin(fut)
4899                        }
4900                    }
4901                    let accept_compression_encodings = self.accept_compression_encodings;
4902                    let send_compression_encodings = self.send_compression_encodings;
4903                    let max_decoding_message_size = self.max_decoding_message_size;
4904                    let max_encoding_message_size = self.max_encoding_message_size;
4905                    let inner = self.inner.clone();
4906                    let fut = async move {
4907                        let method = SetupSvc(inner);
4908                        let codec = tonic::codec::ProstCodec::default();
4909                        let mut grpc = tonic::server::Grpc::new(codec)
4910                            .apply_compression_config(
4911                                accept_compression_encodings,
4912                                send_compression_encodings,
4913                            )
4914                            .apply_max_message_size_config(
4915                                max_decoding_message_size,
4916                                max_encoding_message_size,
4917                            );
4918                        let res = grpc.unary(method, req).await;
4919                        Ok(res)
4920                    };
4921                    Box::pin(fut)
4922                }
4923                "/clementine.ClementineAggregator/NewDeposit" => {
4924                    #[allow(non_camel_case_types)]
4925                    struct NewDepositSvc<T: ClementineAggregator>(pub Arc<T>);
4926                    impl<
4927                        T: ClementineAggregator,
4928                    > tonic::server::UnaryService<super::Deposit> for NewDepositSvc<T> {
4929                        type Response = super::RawSignedTx;
4930                        type Future = BoxFuture<
4931                            tonic::Response<Self::Response>,
4932                            tonic::Status,
4933                        >;
4934                        fn call(
4935                            &mut self,
4936                            request: tonic::Request<super::Deposit>,
4937                        ) -> Self::Future {
4938                            let inner = Arc::clone(&self.0);
4939                            let fut = async move {
4940                                <T as ClementineAggregator>::new_deposit(&inner, request)
4941                                    .await
4942                            };
4943                            Box::pin(fut)
4944                        }
4945                    }
4946                    let accept_compression_encodings = self.accept_compression_encodings;
4947                    let send_compression_encodings = self.send_compression_encodings;
4948                    let max_decoding_message_size = self.max_decoding_message_size;
4949                    let max_encoding_message_size = self.max_encoding_message_size;
4950                    let inner = self.inner.clone();
4951                    let fut = async move {
4952                        let method = NewDepositSvc(inner);
4953                        let codec = tonic::codec::ProstCodec::default();
4954                        let mut grpc = tonic::server::Grpc::new(codec)
4955                            .apply_compression_config(
4956                                accept_compression_encodings,
4957                                send_compression_encodings,
4958                            )
4959                            .apply_max_message_size_config(
4960                                max_decoding_message_size,
4961                                max_encoding_message_size,
4962                            );
4963                        let res = grpc.unary(method, req).await;
4964                        Ok(res)
4965                    };
4966                    Box::pin(fut)
4967                }
4968                "/clementine.ClementineAggregator/Withdraw" => {
4969                    #[allow(non_camel_case_types)]
4970                    struct WithdrawSvc<T: ClementineAggregator>(pub Arc<T>);
4971                    impl<
4972                        T: ClementineAggregator,
4973                    > tonic::server::UnaryService<super::AggregatorWithdrawalInput>
4974                    for WithdrawSvc<T> {
4975                        type Response = super::AggregatorWithdrawResponse;
4976                        type Future = BoxFuture<
4977                            tonic::Response<Self::Response>,
4978                            tonic::Status,
4979                        >;
4980                        fn call(
4981                            &mut self,
4982                            request: tonic::Request<super::AggregatorWithdrawalInput>,
4983                        ) -> Self::Future {
4984                            let inner = Arc::clone(&self.0);
4985                            let fut = async move {
4986                                <T as ClementineAggregator>::withdraw(&inner, request).await
4987                            };
4988                            Box::pin(fut)
4989                        }
4990                    }
4991                    let accept_compression_encodings = self.accept_compression_encodings;
4992                    let send_compression_encodings = self.send_compression_encodings;
4993                    let max_decoding_message_size = self.max_decoding_message_size;
4994                    let max_encoding_message_size = self.max_encoding_message_size;
4995                    let inner = self.inner.clone();
4996                    let fut = async move {
4997                        let method = WithdrawSvc(inner);
4998                        let codec = tonic::codec::ProstCodec::default();
4999                        let mut grpc = tonic::server::Grpc::new(codec)
5000                            .apply_compression_config(
5001                                accept_compression_encodings,
5002                                send_compression_encodings,
5003                            )
5004                            .apply_max_message_size_config(
5005                                max_decoding_message_size,
5006                                max_encoding_message_size,
5007                            );
5008                        let res = grpc.unary(method, req).await;
5009                        Ok(res)
5010                    };
5011                    Box::pin(fut)
5012                }
5013                "/clementine.ClementineAggregator/OptimisticPayout" => {
5014                    #[allow(non_camel_case_types)]
5015                    struct OptimisticPayoutSvc<T: ClementineAggregator>(pub Arc<T>);
5016                    impl<
5017                        T: ClementineAggregator,
5018                    > tonic::server::UnaryService<super::OptimisticWithdrawParams>
5019                    for OptimisticPayoutSvc<T> {
5020                        type Response = super::RawSignedTx;
5021                        type Future = BoxFuture<
5022                            tonic::Response<Self::Response>,
5023                            tonic::Status,
5024                        >;
5025                        fn call(
5026                            &mut self,
5027                            request: tonic::Request<super::OptimisticWithdrawParams>,
5028                        ) -> Self::Future {
5029                            let inner = Arc::clone(&self.0);
5030                            let fut = async move {
5031                                <T as ClementineAggregator>::optimistic_payout(
5032                                        &inner,
5033                                        request,
5034                                    )
5035                                    .await
5036                            };
5037                            Box::pin(fut)
5038                        }
5039                    }
5040                    let accept_compression_encodings = self.accept_compression_encodings;
5041                    let send_compression_encodings = self.send_compression_encodings;
5042                    let max_decoding_message_size = self.max_decoding_message_size;
5043                    let max_encoding_message_size = self.max_encoding_message_size;
5044                    let inner = self.inner.clone();
5045                    let fut = async move {
5046                        let method = OptimisticPayoutSvc(inner);
5047                        let codec = tonic::codec::ProstCodec::default();
5048                        let mut grpc = tonic::server::Grpc::new(codec)
5049                            .apply_compression_config(
5050                                accept_compression_encodings,
5051                                send_compression_encodings,
5052                            )
5053                            .apply_max_message_size_config(
5054                                max_decoding_message_size,
5055                                max_encoding_message_size,
5056                            );
5057                        let res = grpc.unary(method, req).await;
5058                        Ok(res)
5059                    };
5060                    Box::pin(fut)
5061                }
5062                "/clementine.ClementineAggregator/InternalSendTx" => {
5063                    #[allow(non_camel_case_types)]
5064                    struct InternalSendTxSvc<T: ClementineAggregator>(pub Arc<T>);
5065                    impl<
5066                        T: ClementineAggregator,
5067                    > tonic::server::UnaryService<super::SendTxRequest>
5068                    for InternalSendTxSvc<T> {
5069                        type Response = super::Empty;
5070                        type Future = BoxFuture<
5071                            tonic::Response<Self::Response>,
5072                            tonic::Status,
5073                        >;
5074                        fn call(
5075                            &mut self,
5076                            request: tonic::Request<super::SendTxRequest>,
5077                        ) -> Self::Future {
5078                            let inner = Arc::clone(&self.0);
5079                            let fut = async move {
5080                                <T as ClementineAggregator>::internal_send_tx(
5081                                        &inner,
5082                                        request,
5083                                    )
5084                                    .await
5085                            };
5086                            Box::pin(fut)
5087                        }
5088                    }
5089                    let accept_compression_encodings = self.accept_compression_encodings;
5090                    let send_compression_encodings = self.send_compression_encodings;
5091                    let max_decoding_message_size = self.max_decoding_message_size;
5092                    let max_encoding_message_size = self.max_encoding_message_size;
5093                    let inner = self.inner.clone();
5094                    let fut = async move {
5095                        let method = InternalSendTxSvc(inner);
5096                        let codec = tonic::codec::ProstCodec::default();
5097                        let mut grpc = tonic::server::Grpc::new(codec)
5098                            .apply_compression_config(
5099                                accept_compression_encodings,
5100                                send_compression_encodings,
5101                            )
5102                            .apply_max_message_size_config(
5103                                max_decoding_message_size,
5104                                max_encoding_message_size,
5105                            );
5106                        let res = grpc.unary(method, req).await;
5107                        Ok(res)
5108                    };
5109                    Box::pin(fut)
5110                }
5111                "/clementine.ClementineAggregator/SendMoveToVaultTx" => {
5112                    #[allow(non_camel_case_types)]
5113                    struct SendMoveToVaultTxSvc<T: ClementineAggregator>(pub Arc<T>);
5114                    impl<
5115                        T: ClementineAggregator,
5116                    > tonic::server::UnaryService<super::SendMoveTxRequest>
5117                    for SendMoveToVaultTxSvc<T> {
5118                        type Response = super::Txid;
5119                        type Future = BoxFuture<
5120                            tonic::Response<Self::Response>,
5121                            tonic::Status,
5122                        >;
5123                        fn call(
5124                            &mut self,
5125                            request: tonic::Request<super::SendMoveTxRequest>,
5126                        ) -> Self::Future {
5127                            let inner = Arc::clone(&self.0);
5128                            let fut = async move {
5129                                <T as ClementineAggregator>::send_move_to_vault_tx(
5130                                        &inner,
5131                                        request,
5132                                    )
5133                                    .await
5134                            };
5135                            Box::pin(fut)
5136                        }
5137                    }
5138                    let accept_compression_encodings = self.accept_compression_encodings;
5139                    let send_compression_encodings = self.send_compression_encodings;
5140                    let max_decoding_message_size = self.max_decoding_message_size;
5141                    let max_encoding_message_size = self.max_encoding_message_size;
5142                    let inner = self.inner.clone();
5143                    let fut = async move {
5144                        let method = SendMoveToVaultTxSvc(inner);
5145                        let codec = tonic::codec::ProstCodec::default();
5146                        let mut grpc = tonic::server::Grpc::new(codec)
5147                            .apply_compression_config(
5148                                accept_compression_encodings,
5149                                send_compression_encodings,
5150                            )
5151                            .apply_max_message_size_config(
5152                                max_decoding_message_size,
5153                                max_encoding_message_size,
5154                            );
5155                        let res = grpc.unary(method, req).await;
5156                        Ok(res)
5157                    };
5158                    Box::pin(fut)
5159                }
5160                "/clementine.ClementineAggregator/GetEntityStatuses" => {
5161                    #[allow(non_camel_case_types)]
5162                    struct GetEntityStatusesSvc<T: ClementineAggregator>(pub Arc<T>);
5163                    impl<
5164                        T: ClementineAggregator,
5165                    > tonic::server::UnaryService<super::GetEntityStatusesRequest>
5166                    for GetEntityStatusesSvc<T> {
5167                        type Response = super::EntityStatuses;
5168                        type Future = BoxFuture<
5169                            tonic::Response<Self::Response>,
5170                            tonic::Status,
5171                        >;
5172                        fn call(
5173                            &mut self,
5174                            request: tonic::Request<super::GetEntityStatusesRequest>,
5175                        ) -> Self::Future {
5176                            let inner = Arc::clone(&self.0);
5177                            let fut = async move {
5178                                <T as ClementineAggregator>::get_entity_statuses(
5179                                        &inner,
5180                                        request,
5181                                    )
5182                                    .await
5183                            };
5184                            Box::pin(fut)
5185                        }
5186                    }
5187                    let accept_compression_encodings = self.accept_compression_encodings;
5188                    let send_compression_encodings = self.send_compression_encodings;
5189                    let max_decoding_message_size = self.max_decoding_message_size;
5190                    let max_encoding_message_size = self.max_encoding_message_size;
5191                    let inner = self.inner.clone();
5192                    let fut = async move {
5193                        let method = GetEntityStatusesSvc(inner);
5194                        let codec = tonic::codec::ProstCodec::default();
5195                        let mut grpc = tonic::server::Grpc::new(codec)
5196                            .apply_compression_config(
5197                                accept_compression_encodings,
5198                                send_compression_encodings,
5199                            )
5200                            .apply_max_message_size_config(
5201                                max_decoding_message_size,
5202                                max_encoding_message_size,
5203                            );
5204                        let res = grpc.unary(method, req).await;
5205                        Ok(res)
5206                    };
5207                    Box::pin(fut)
5208                }
5209                "/clementine.ClementineAggregator/InternalGetEmergencyStopTx" => {
5210                    #[allow(non_camel_case_types)]
5211                    struct InternalGetEmergencyStopTxSvc<T: ClementineAggregator>(
5212                        pub Arc<T>,
5213                    );
5214                    impl<
5215                        T: ClementineAggregator,
5216                    > tonic::server::UnaryService<super::GetEmergencyStopTxRequest>
5217                    for InternalGetEmergencyStopTxSvc<T> {
5218                        type Response = super::GetEmergencyStopTxResponse;
5219                        type Future = BoxFuture<
5220                            tonic::Response<Self::Response>,
5221                            tonic::Status,
5222                        >;
5223                        fn call(
5224                            &mut self,
5225                            request: tonic::Request<super::GetEmergencyStopTxRequest>,
5226                        ) -> Self::Future {
5227                            let inner = Arc::clone(&self.0);
5228                            let fut = async move {
5229                                <T as ClementineAggregator>::internal_get_emergency_stop_tx(
5230                                        &inner,
5231                                        request,
5232                                    )
5233                                    .await
5234                            };
5235                            Box::pin(fut)
5236                        }
5237                    }
5238                    let accept_compression_encodings = self.accept_compression_encodings;
5239                    let send_compression_encodings = self.send_compression_encodings;
5240                    let max_decoding_message_size = self.max_decoding_message_size;
5241                    let max_encoding_message_size = self.max_encoding_message_size;
5242                    let inner = self.inner.clone();
5243                    let fut = async move {
5244                        let method = InternalGetEmergencyStopTxSvc(inner);
5245                        let codec = tonic::codec::ProstCodec::default();
5246                        let mut grpc = tonic::server::Grpc::new(codec)
5247                            .apply_compression_config(
5248                                accept_compression_encodings,
5249                                send_compression_encodings,
5250                            )
5251                            .apply_max_message_size_config(
5252                                max_decoding_message_size,
5253                                max_encoding_message_size,
5254                            );
5255                        let res = grpc.unary(method, req).await;
5256                        Ok(res)
5257                    };
5258                    Box::pin(fut)
5259                }
5260                "/clementine.ClementineAggregator/Vergen" => {
5261                    #[allow(non_camel_case_types)]
5262                    struct VergenSvc<T: ClementineAggregator>(pub Arc<T>);
5263                    impl<
5264                        T: ClementineAggregator,
5265                    > tonic::server::UnaryService<super::Empty> for VergenSvc<T> {
5266                        type Response = super::VergenResponse;
5267                        type Future = BoxFuture<
5268                            tonic::Response<Self::Response>,
5269                            tonic::Status,
5270                        >;
5271                        fn call(
5272                            &mut self,
5273                            request: tonic::Request<super::Empty>,
5274                        ) -> Self::Future {
5275                            let inner = Arc::clone(&self.0);
5276                            let fut = async move {
5277                                <T as ClementineAggregator>::vergen(&inner, request).await
5278                            };
5279                            Box::pin(fut)
5280                        }
5281                    }
5282                    let accept_compression_encodings = self.accept_compression_encodings;
5283                    let send_compression_encodings = self.send_compression_encodings;
5284                    let max_decoding_message_size = self.max_decoding_message_size;
5285                    let max_encoding_message_size = self.max_encoding_message_size;
5286                    let inner = self.inner.clone();
5287                    let fut = async move {
5288                        let method = VergenSvc(inner);
5289                        let codec = tonic::codec::ProstCodec::default();
5290                        let mut grpc = tonic::server::Grpc::new(codec)
5291                            .apply_compression_config(
5292                                accept_compression_encodings,
5293                                send_compression_encodings,
5294                            )
5295                            .apply_max_message_size_config(
5296                                max_decoding_message_size,
5297                                max_encoding_message_size,
5298                            );
5299                        let res = grpc.unary(method, req).await;
5300                        Ok(res)
5301                    };
5302                    Box::pin(fut)
5303                }
5304                _ => {
5305                    Box::pin(async move {
5306                        let mut response = http::Response::new(empty_body());
5307                        let headers = response.headers_mut();
5308                        headers
5309                            .insert(
5310                                tonic::Status::GRPC_STATUS,
5311                                (tonic::Code::Unimplemented as i32).into(),
5312                            );
5313                        headers
5314                            .insert(
5315                                http::header::CONTENT_TYPE,
5316                                tonic::metadata::GRPC_CONTENT_TYPE,
5317                            );
5318                        Ok(response)
5319                    })
5320                }
5321            }
5322        }
5323    }
5324    impl<T> Clone for ClementineAggregatorServer<T> {
5325        fn clone(&self) -> Self {
5326            let inner = self.inner.clone();
5327            Self {
5328                inner,
5329                accept_compression_encodings: self.accept_compression_encodings,
5330                send_compression_encodings: self.send_compression_encodings,
5331                max_decoding_message_size: self.max_decoding_message_size,
5332                max_encoding_message_size: self.max_encoding_message_size,
5333            }
5334        }
5335    }
5336    /// Generated gRPC service name
5337    pub const SERVICE_NAME: &str = "clementine.ClementineAggregator";
5338    impl<T> tonic::server::NamedService for ClementineAggregatorServer<T> {
5339        const NAME: &'static str = SERVICE_NAME;
5340    }
5341}