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