pub trait ClementineOperator:
Send
+ Sync
+ 'static {
type GetParamsStream: Stream<Item = Result<OperatorParams, Status>> + Send + 'static;
type DepositSignStream: Stream<Item = Result<SchnorrSig, Status>> + Send + 'static;
// 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 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 withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<WithdrawResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn withdrawal_finalized<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawalFinalizedParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, 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 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 withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<WithdrawResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn withdraw<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<WithdrawResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepares a withdrawal if it’s profitable and previous sequential_collateral_tx’s timelock has ended, by paying for the withdrawal and locking the current sequential_collateral_tx.
Sourcefn withdrawal_finalized<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawalFinalizedParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn withdrawal_finalized<'life0, 'async_trait>(
&'life0 self,
request: Request<WithdrawalFinalizedParams>,
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if a withdrawal is finalized.
Steps:
- Calculate move_txid and check if the withdrawal idx matches it
- Check if it is proved on citrea
- Send operator_take_txs
§Parameters
- withdrawal_id: Withdrawal’s ID
- deposit_outpoint: Withdrawal’s deposit UTXO
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