pub struct LiquidModule { /* private fields */ }Expand description
Liquid Network client with full functionality
Implementations§
Source§impl LiquidModule
impl LiquidModule
Sourcepub fn new(config: LiquidConfig) -> Self
pub fn new(config: LiquidConfig) -> Self
Create a new Liquid client
Sourcepub fn get_config(&self) -> &LiquidConfig
pub fn get_config(&self) -> &LiquidConfig
Get Liquid-specific configuration
Sourcepub async fn peg_in(
&mut self,
request: PegInRequest,
) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn peg_in( &mut self, request: PegInRequest, ) -> Result<String, Box<dyn Error + Send + Sync>>
Initiate peg-in from Bitcoin to Liquid
Sourcepub async fn peg_out(
&mut self,
request: PegOutRequest,
) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn peg_out( &mut self, request: PegOutRequest, ) -> Result<String, Box<dyn Error + Send + Sync>>
Initiate peg-out from Liquid to Bitcoin
Sourcepub async fn issue_confidential_asset(
&mut self,
asset: LiquidAsset,
) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn issue_confidential_asset( &mut self, asset: LiquidAsset, ) -> Result<String, Box<dyn Error + Send + Sync>>
Issue a new confidential asset on Liquid
Sourcepub async fn create_confidential_transaction(
&self,
inputs: Vec<ConfidentialInput>,
outputs: Vec<ConfidentialOutput>,
) -> Result<ConfidentialTransaction, Box<dyn Error + Send + Sync>>
pub async fn create_confidential_transaction( &self, inputs: Vec<ConfidentialInput>, outputs: Vec<ConfidentialOutput>, ) -> Result<ConfidentialTransaction, Box<dyn Error + Send + Sync>>
Create a confidential transaction with blinded amounts and assets
Sourcepub async fn execute_atomic_swap(
&self,
swap: AtomicSwap,
secret: &str,
) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn execute_atomic_swap( &self, swap: AtomicSwap, secret: &str, ) -> Result<String, Box<dyn Error + Send + Sync>>
Execute atomic swap between assets
Sourcepub fn get_asset_registry(&self) -> &HashMap<String, LiquidAsset>
pub fn get_asset_registry(&self) -> &HashMap<String, LiquidAsset>
Get asset registry information
Trait Implementations§
Source§impl Clone for LiquidModule
impl Clone for LiquidModule
Source§fn clone(&self) -> LiquidModule
fn clone(&self) -> LiquidModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LiquidModule
impl Debug for LiquidModule
Source§impl Default for LiquidModule
impl Default for LiquidModule
Source§impl Layer2Protocol for LiquidModule
Implementation of async Layer2Protocol trait for LiquidModule
impl Layer2Protocol for LiquidModule
Implementation of async Layer2Protocol trait for LiquidModule
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ProtocolState, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_transaction_status<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync_state<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn issue_asset<'life0, 'async_trait>(
&'life0 self,
params: AssetParams,
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transfer_asset<'life0, 'async_trait>(
&'life0 self,
transfer: AssetTransfer,
) -> Pin<Box<dyn Future<Output = Result<TransferResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn verify_proof<'life0, 'async_trait>(
&'life0 self,
proof: Proof,
) -> Pin<Box<dyn Future<Output = Result<VerificationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state_data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<ValidationResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Layer2ProtocolTrait for LiquidModule
impl Layer2ProtocolTrait for LiquidModule
Source§fn initialize(&self) -> Result<(), Box<dyn Error + Send + Sync>>
fn initialize(&self) -> Result<(), Box<dyn Error + Send + Sync>>
Initialize the Liquid protocol
Source§fn get_state(&self) -> Result<ProtocolState, Box<dyn Error + Send + Sync>>
fn get_state(&self) -> Result<ProtocolState, Box<dyn Error + Send + Sync>>
Get the current state of the protocol
Source§fn submit_transaction(
&self,
tx_data: &[u8],
) -> Result<String, Box<dyn Error + Send + Sync>>
fn submit_transaction( &self, tx_data: &[u8], ) -> Result<String, Box<dyn Error + Send + Sync>>
Submit a transaction to Liquid
Source§fn check_transaction_status(
&self,
tx_id: &str,
) -> Result<TransactionStatus, Box<dyn Error + Send + Sync>>
fn check_transaction_status( &self, tx_id: &str, ) -> Result<TransactionStatus, Box<dyn Error + Send + Sync>>
Check transaction status
Source§fn sync_state(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
fn sync_state(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
Synchronize state with Liquid network
Source§fn issue_asset(
&self,
params: AssetParams,
) -> Result<String, Box<dyn Error + Send + Sync>>
fn issue_asset( &self, params: AssetParams, ) -> Result<String, Box<dyn Error + Send + Sync>>
Issue an asset on Liquid
Source§fn transfer_asset(
&self,
transfer: AssetTransfer,
) -> Result<TransferResult, Box<dyn Error + Send + Sync>>
fn transfer_asset( &self, transfer: AssetTransfer, ) -> Result<TransferResult, Box<dyn Error + Send + Sync>>
Transfer an asset on Liquid
Source§fn verify_proof(
&self,
proof: Proof,
) -> Result<VerificationResult, Box<dyn Error + Send + Sync>>
fn verify_proof( &self, proof: Proof, ) -> Result<VerificationResult, Box<dyn Error + Send + Sync>>
Verify a proof on Liquid
Source§fn validate_state(
&self,
state_data: &[u8],
) -> Result<ValidationResult, Box<dyn Error + Send + Sync>>
fn validate_state( &self, state_data: &[u8], ) -> Result<ValidationResult, Box<dyn Error + Send + Sync>>
Validate state on Liquid
Auto Trait Implementations§
impl Freeze for LiquidModule
impl RefUnwindSafe for LiquidModule
impl Send for LiquidModule
impl Sync for LiquidModule
impl Unpin for LiquidModule
impl UnwindSafe for LiquidModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more