pub struct ContractManager { /* private fields */ }Expand description
Contract Manager for DLC contracts [AIR-3][AIS-3][BPC-3][RES-3]
Implementations§
Source§impl ContractManager
impl ContractManager
Sourcepub async fn create_contract(
&self,
_settlement_address: &str,
collateral: u64,
oracle_info: &OracleEvent,
payout_curve: &PayoutCurve,
) -> Result<DlcContract, DlcError>
pub async fn create_contract( &self, _settlement_address: &str, collateral: u64, oracle_info: &OracleEvent, payout_curve: &PayoutCurve, ) -> Result<DlcContract, DlcError>
Create a new DLC contract [AIR-3][AIS-3][BPC-3][RES-3]
Sourcepub fn sign_contract(
&self,
contract: &DlcContract,
private_key: &SecretKey,
) -> Result<DlcSignature, DlcError>
pub fn sign_contract( &self, contract: &DlcContract, private_key: &SecretKey, ) -> Result<DlcSignature, DlcError>
Sign a DLC contract [AIR-3][AIS-3][BPC-3][RES-3]
Sourcepub fn execute_contract(
&self,
contract: &DlcContract,
attestation: &OracleAttestation,
) -> Result<DlcExecution, DlcError>
pub fn execute_contract( &self, contract: &DlcContract, attestation: &OracleAttestation, ) -> Result<DlcExecution, DlcError>
Execute a DLC contract based on oracle attestation [AIR-3][AIS-3][BPC-3][RES-3]
Sourcepub fn into_inner(hash_bytes: &[u8; 32]) -> Hash
pub fn into_inner(hash_bytes: &[u8; 32]) -> Hash
Convert byte array to sha256::Hash [AIR-3][AIS-3][BPC-3][RES-3]
Sourcepub fn broadcast_contract(
&self,
contract: &DlcContract,
) -> Result<String, DlcError>
pub fn broadcast_contract( &self, contract: &DlcContract, ) -> Result<String, DlcError>
Broadcast a DLC contract to the Bitcoin network [AIR-3][AIS-3][BPC-3][RES-3]
Sourcepub fn settle_contract(
&self,
contract: &DlcContract,
attestation: &OracleAttestation,
) -> Result<DlcExecution, DlcError>
pub fn settle_contract( &self, contract: &DlcContract, attestation: &OracleAttestation, ) -> Result<DlcExecution, DlcError>
Settle a DLC contract based on oracle attestation [AIR-3][AIS-3][BPC-3][RES-3]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContractManager
impl RefUnwindSafe for ContractManager
impl Send for ContractManager
impl Sync for ContractManager
impl Unpin for ContractManager
impl UnwindSafe for ContractManager
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> 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