pub struct LBtcSwapScript {
pub swap_type: SwapType,
pub side: Option<Side>,
pub funding_addrs: Option<Address>,
pub hashlock: Hash,
pub receiver_pubkey: PublicKey,
pub locktime: LockTime,
pub sender_pubkey: PublicKey,
pub blinding_key: Keypair,
}Expand description
Liquid v2 swap script helper.
Fields§
§swap_type: SwapType§side: Option<Side>§funding_addrs: Option<Address>§hashlock: Hash§receiver_pubkey: PublicKey§locktime: LockTime§sender_pubkey: PublicKey§blinding_key: KeypairImplementations§
Source§impl LBtcSwapScript
impl LBtcSwapScript
Sourcepub fn submarine_from_swap_resp(
create_swap_response: &CreateSubmarineResponse,
our_pubkey: PublicKey,
) -> Result<Self, Error>
pub fn submarine_from_swap_resp( create_swap_response: &CreateSubmarineResponse, our_pubkey: PublicKey, ) -> Result<Self, Error>
Create the struct for a submarine swap from boltz create response.
Sourcepub fn reverse_from_swap_resp(
reverse_response: &CreateReverseResponse,
our_pubkey: PublicKey,
) -> Result<Self, Error>
pub fn reverse_from_swap_resp( reverse_response: &CreateReverseResponse, our_pubkey: PublicKey, ) -> Result<Self, Error>
Create the struct for a reverse swap from boltz create response.
Sourcepub fn chain_from_swap_resp(
side: Side,
chain_swap_details: ChainSwapDetails,
our_pubkey: PublicKey,
) -> Result<Self, Error>
pub fn chain_from_swap_resp( side: Side, chain_swap_details: ChainSwapDetails, our_pubkey: PublicKey, ) -> Result<Self, Error>
Create the struct for a chain swap from boltz create response.
pub fn musig_keyagg_cache(&self) -> KeyAggCache
Sourcepub fn to_address(&self, network: LiquidChain) -> Result<EAddress, Error>
pub fn to_address(&self, network: LiquidChain) -> Result<EAddress, Error>
Get taproot address for the swap script. Always returns a confidential address
pub fn validate_address( &self, chain: LiquidChain, address: String, ) -> Result<(), Error>
Sourcepub async fn fetch_utxo<LC: LiquidClient + ?Sized>(
&self,
liquid_client: &LC,
) -> Result<Option<(OutPoint, TxOut)>, Error>
pub async fn fetch_utxo<LC: LiquidClient + ?Sized>( &self, liquid_client: &LC, ) -> Result<Option<(OutPoint, TxOut)>, Error>
Fetch utxo for script from Electrum
Sourcepub async fn fetch_lockup_utxo_boltz(
&self,
network: LiquidChain,
boltz_client: &BoltzApiClientV2,
swap_id: &str,
tx_kind: SwapTxKind,
) -> Result<(OutPoint, TxOut), Error>
pub async fn fetch_lockup_utxo_boltz( &self, network: LiquidChain, boltz_client: &BoltzApiClientV2, swap_id: &str, tx_kind: SwapTxKind, ) -> Result<(OutPoint, TxOut), Error>
Fetch utxo for script from BoltzApi
pub async fn genesis_hash<LC: LiquidClient>( &self, liquid_client: &LC, ) -> Result<BlockHash, Error>
Trait Implementations§
Source§impl Clone for LBtcSwapScript
impl Clone for LBtcSwapScript
Source§fn clone(&self) -> LBtcSwapScript
fn clone(&self) -> LBtcSwapScript
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LBtcSwapScript
impl Debug for LBtcSwapScript
Source§impl PartialEq for LBtcSwapScript
impl PartialEq for LBtcSwapScript
Source§impl SwapScriptCommon for LBtcSwapScript
impl SwapScriptCommon for LBtcSwapScript
Source§fn partial_sign(
&self,
keys: &Keypair,
pub_nonce: &str,
transaction_hash: &str,
) -> Result<(PartialSignature, PublicNonce), Error>
fn partial_sign( &self, keys: &Keypair, pub_nonce: &str, transaction_hash: &str, ) -> Result<(PartialSignature, PublicNonce), Error>
Compute the Musig partial signature. This is used to cooperatively close a Submarine or Chain Swap.
fn swap_type(&self) -> SwapType
impl StructuralPartialEq for LBtcSwapScript
Auto Trait Implementations§
impl Freeze for LBtcSwapScript
impl RefUnwindSafe for LBtcSwapScript
impl Send for LBtcSwapScript
impl Sync for LBtcSwapScript
impl Unpin for LBtcSwapScript
impl UnwindSafe for LBtcSwapScript
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)