pub trait CitreaClientT:
Send
+ Sync
+ Debug
+ Clone
+ 'static {
// Required methods
fn new<'async_trait>(
citrea_rpc_url: String,
light_client_prover_url: String,
chain_id: u32,
secret_key: Option<PrivateKeySigner>,
) -> Pin<Box<dyn Future<Output = Result<Self, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
withdrawal_index: u64,
) -> Pin<Box<dyn Future<Output = Result<OutPoint, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn collect_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
last_deposit_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Txid)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn collect_withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
last_withdrawal_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, OutPoint)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_light_client_proof<'life0, 'async_trait>(
&'life0 self,
l1_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<(LightClientProof, Receipt, u64)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_citrea_l2_height_range<'life0, 'async_trait>(
&'life0 self,
block_height: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(u64, u64), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_replacement_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
from_height: u64,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, Txid)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_nofn_correctness<'life0, 'async_trait>(
&'life0 self,
nofn_xonly_pk: XOnlyPublicKey,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_storage_proof<'life0, 'async_trait>(
&'life0 self,
l2_height: u64,
deposit_index: u32,
) -> Pin<Box<dyn Future<Output = Result<StorageProof, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
Sourcefn new<'async_trait>(
citrea_rpc_url: String,
light_client_prover_url: String,
chain_id: u32,
secret_key: Option<PrivateKeySigner>,
) -> Pin<Box<dyn Future<Output = Result<Self, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn new<'async_trait>(
citrea_rpc_url: String,
light_client_prover_url: String,
chain_id: u32,
secret_key: Option<PrivateKeySigner>,
) -> Pin<Box<dyn Future<Output = Result<Self, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
§Parameters
citrea_rpc_url
: URL of the Citrea RPC.light_client_prover_url
: URL of the Citrea light client prover RPC.chain_id
: Citrea’s EVM chain id.secret_key
: EVM secret key of the EVM user. If not given, random secret key is used (wallet is not required). This is given mostly for testing purposes.
Sourcefn withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
withdrawal_index: u64,
) -> Pin<Box<dyn Future<Output = Result<OutPoint, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
withdrawal_index: u64,
) -> Pin<Box<dyn Future<Output = Result<OutPoint, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn collect_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
last_deposit_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Txid)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collect_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
last_deposit_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Txid)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns deposit move txids, starting from the last deposit index.
§Parameters
last_deposit_idx
: Last deposit index. None if no depositto_height
: End block height (inclusive)
Sourcefn collect_withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
last_withdrawal_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, OutPoint)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collect_withdrawal_utxos<'life0, 'async_trait>(
&'life0 self,
last_withdrawal_idx: Option<u32>,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, OutPoint)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns withdrawal utxos, starting from the last withdrawal index.
§Parameters
last_withdrawal_idx
: Last withdrawal index. None if no withdrawalto_height
: End block height (inclusive)
Sourcefn get_light_client_proof<'life0, 'async_trait>(
&'life0 self,
l1_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<(LightClientProof, Receipt, u64)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_light_client_proof<'life0, 'async_trait>(
&'life0 self,
l1_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<(LightClientProof, Receipt, u64)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_citrea_l2_height_range<'life0, 'async_trait>(
&'life0 self,
block_height: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(u64, u64), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_citrea_l2_height_range<'life0, 'async_trait>(
&'life0 self,
block_height: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(u64, u64), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the L2 block height range for the given L1 block height.
TODO: This is not the best way to do this, but it’s a quick fix for now it will attempt to fetch the light client proof max_attempts times with 1 second intervals.
§Parameters
block_height
: L1 block height.timeout
: Timeout duration.
§Returns
A tuple of:
Sourcefn get_replacement_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
from_height: u64,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, Txid)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_replacement_deposit_move_txids<'life0, 'async_trait>(
&'life0 self,
from_height: u64,
to_height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, Txid)>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_nofn_correctness<'life0, 'async_trait>(
&'life0 self,
nofn_xonly_pk: XOnlyPublicKey,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_storage_proof<'life0, 'async_trait>(
&'life0 self,
l2_height: u64,
deposit_index: u32,
) -> Pin<Box<dyn Future<Output = Result<StorageProof, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.