pub trait ClementineOperator:
Send
+ Sync
+ 'static {
type GetParamsStream: Stream<Item = Result<OperatorParams, Status>> + Send + 'static;
type DepositSignStream: Stream<Item = Result<SchnorrSig, Status>> + Send + 'static;
Show 14 methods
// Required methods
fn get_x_only_public_key<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<XOnlyPublicKeyRpc>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_params<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetParamsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_deposit_keys<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<OperatorKeys>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_current_status<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<EntityStatus>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn deposit_sign<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositSignSession>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::DepositSignStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restart_background_tasks<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn internal_withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParamsWithSig>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_reimbursement_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<Outpoint>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn internal_create_signed_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn internal_create_assert_commitment_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn internal_finalized_payout<'life0, 'async_trait>(
&'life0 self,
request: Request<FinalizedPayoutParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<Txid>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn internal_end_round<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn vergen<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<VergenResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Generated trait containing gRPC methods that should be implemented for use with ClementineOperatorServer.
Required Associated Types§
Sourcetype GetParamsStream: Stream<Item = Result<OperatorParams, Status>> + Send + 'static
type GetParamsStream: Stream<Item = Result<OperatorParams, Status>> + Send + 'static
Server streaming response type for the GetParams method.
Sourcetype DepositSignStream: Stream<Item = Result<SchnorrSig, Status>> + Send + 'static
type DepositSignStream: Stream<Item = Result<SchnorrSig, Status>> + Send + 'static
Server streaming response type for the DepositSign method.
Required Methods§
Sourcefn get_x_only_public_key<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<XOnlyPublicKeyRpc>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_x_only_public_key<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<XOnlyPublicKeyRpc>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the operator’s xonly public key
Used by aggregator inside setup
Sourcefn get_params<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetParamsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_params<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetParamsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns an operator’s parameters. It will be called once, by the aggregator, to set all the public keys.
§Returns
Returns an [OperatorParams
], which includes operator’s configuration and
Watchtower parameters.
Used by aggregator inside setup
Sourcefn get_deposit_keys<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<OperatorKeys>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_deposit_keys<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<OperatorKeys>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns an operator’s deposit keys. Deposit keys include Assert BitVM winternitz keys, and challenge ACK hashes.
Used by aggregator inside new_deposit
Sourcefn get_current_status<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<EntityStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_status<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<EntityStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the current status of tasks running on the operator and their last synced heights.
Sourcefn deposit_sign<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositSignSession>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::DepositSignStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn deposit_sign<'life0, 'async_trait>(
&'life0 self,
request: Request<DepositSignSession>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::DepositSignStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn restart_background_tasks<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restart_background_tasks<'life0, 'async_trait>(
&'life0 self,
request: Request<Empty>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Restarts the background tasks for the operator.
Sourcefn internal_withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn internal_withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepares a withdrawal if it’s profitable and the withdrawal is correct and registered in Citrea bridge contract. If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned. If automation is disabled, the withdrawal will not be accepted and an error will be returned. Note: This is intended for operator’s own use, so it doesn’t include a signature from aggregator.
Sourcefn withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParamsWithSig>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParamsWithSig>,
) -> Pin<Box<dyn Future<Output = Result<Response<RawSignedTx>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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. Then prepares a withdrawal if it’s profitable and the withdrawal is correct and registered in Citrea bridge contract. If withdrawal is accepted, the payout tx will be added to the TxSender and success is returned, otherwise an error is returned. If automation is disabled, the withdrawal will not be accepted and an error will be returned.
Sourcefn get_reimbursement_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<Outpoint>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_reimbursement_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<Outpoint>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
For a given deposit outpoint, determines the next step in the kickoff process the operator is in, and returns the raw signed txs that the operator needs to send next, for enabling reimbursement process without automation.
§Parameters
- deposit_outpoint: Deposit outpoint to create the kickoff for
§Returns
- Raw signed txs that the operator needs to send next
Sourcefn internal_create_signed_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn internal_create_signed_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Signs all tx’s it can according to given transaction type (use it with AllNeededForDeposit to get almost all tx’s) Creates the transactions denoted by the deposit and operator_idx, round_idx, and kickoff_idx. It will create the transaction and sign it with the operator’s private key and/or saved nofn signatures.
§Parameters
- deposit_params: User’s deposit information
- transaction_type: Requested Transaction type
- kickoff_id: Operator’s kickoff ID
§Returns
- Raw signed transactions that the entity can sign (no asserts and watchtower challenge)
Only used in tests
Sourcefn internal_create_assert_commitment_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn internal_create_assert_commitment_txs<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignedTxsWithType>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates all assert transactions (AssertBegin, MiniAsserts, AssertEnd), signs them, and returns the raw txs in the same order.
§Parameters
- deposit_params: User’s deposit information
- kickoff_id: Operator’s kickoff ID
- commit_data: Commitment data for each MiniAssert tx’s
§Returns
- Raw signed assert transactions